![](/media/cache/profiles/e8c1bdc555e17fd06b44ea4d3b4adbda.jpg.50x50_q85.jpg)
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>
EthernetInterface.lib@1:4c31b3159209, 2014-12-15 (annotated)
- Committer:
- YuuichiAkagawa
- Date:
- Mon Dec 15 15:41:47 2014 +0000
- Revision:
- 1:4c31b3159209
- Parent:
- 0:160f68fca7a0
update sample
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
YuuichiAkagawa | 0:160f68fca7a0 | 1 | http://mbed.org/users/mbed_official/code/EthernetInterface/#de796e2a5e98 |