FluentLogger: fluent-logger-mbed A structured logger for Fluentd (mbed)
Dependents: FluentLogger_Hello SNIC-FluentLogger-example
FluentLogger
What is this ?
You can logging to Fluentd server.
This library included subset of MassagePack library.
Supported MessagePack formats(encode only)
format name | first byte (in hex) |
---|---|
positive fixint | 0x00 - 0x7f |
fixmap | 0x80 - 0x8f |
fixarray | 0x90 - 0x9f |
fixstr | 0xa0 - 0xbf |
nil | 0xc0 |
false | 0xc2 |
true | 0xc3 |
float 32 | 0xca |
float 64 | 0xcb |
uint 8 | 0xcc |
uint 16 | 0xcd |
uint 32 | 0xce |
uint 64 | 0xcf |
int 8 | 0xd0 |
int 16 | 0xd1 |
int 32 | 0xd2 |
int 64 | 0xd3 |
str 8 | 0xd9 |
negative fixint | 0xe0 - 0xff |
これは何?
Fluentd サーバにログを送信するためのライブラリです。
サブセット版のMassagePackライブラリも同梱しています。
サーバ側ダウン時の再接続機能は限定的に実装されています。 現時点での実装は送信時に切断を検知し、次回送信時に再接続する仕様です。
Diff: FluentLogger.cpp
- Revision:
- 1:6b1268731465
- Parent:
- 0:b4815a079a4b
--- a/FluentLogger.cpp Tue Nov 11 02:14:44 2014 +0000 +++ b/FluentLogger.cpp Mon Dec 15 15:37:23 2014 +0000 @@ -61,7 +61,7 @@ _mp->init(); // tag, timestamp, message - if (!_mp->set_array(3)) { + if (!_mp->start_array(3)) { return -1; } if (!_mp->set_str(tag, strlen(tag))) { @@ -84,7 +84,7 @@ int FluentLogger::log(const char *tag, uMP &mpmsg) { - if (!_sock->is_connected()) { + if (_sock == NULL || !_sock->is_connected()) { if (open() < 0) { return -1; } @@ -92,7 +92,7 @@ _mp->init(); // tag, timestamp, message - if (!_mp->set_array(3)) { + if (!_mp->start_array(3)) { return -1; } if (!_mp->set_str(tag, strlen(tag))) {