Sample for the FluentLogger library.
Dependencies: EthernetInterface FluentLogger mbed-rtos mbed
Example for simple message logging.
main.cpp
#include "mbed.h" #include "rtos.h" #include "EthernetInterface.h" #include "FluentLogger.h" EthernetInterface eth; FluentLogger logger("192.168.0.1"); // please set your Fluentd server int main() { eth.init(); //Use DHCP eth.connect(); while(1) { logger.log("debug.mbed", "Hello mbed"); //message body is simple string wait_ms(10000); } logger.close(); eth.disconnect(); }
Server Configuration
Fluentd daemon must be lauched with the following configuration:
<source> type tcp port 24224 </source> <match debug.**> type stdout </match>
Diff: FluentLogger.lib
- Revision:
- 0:160f68fca7a0
- Child:
- 1:4c31b3159209
diff -r 000000000000 -r 160f68fca7a0 FluentLogger.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FluentLogger.lib Tue Nov 11 12:59:34 2014 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/YuuichiAkagawa/code/FluentLogger/#b4815a079a4b