Syslog icon indicating copy to clipboard operation
Syslog copied to clipboard

Allow multiple outputs

Open sle118 opened this issue 8 years ago • 3 comments

@arcao

I would like to suggest a feature for this project.

Given that it might be interesting to be able retrieve logs that might have been created while a device didn't have access to the network or while the syslog server was down, it would be nice to offer an option to have a buffer page of a predetermined size and periodically rotate it. In order to minimize the impact to the memory, the logs could be written to a SPIFFS file. Maybe this is an overkill for the flash memory, I don't know what sort of abuse it can sustain in terms of write/erase cycles.

Please let me know your thoughts.

sle118 avatar Feb 22 '17 19:02 sle118

👍 I like this idea. More appenders like UdpSyslogAppender, BsdUdpSyslogAppender, PrinterSyslogApender, FileSyslogAppender, etc.

and usage like:


// define
UdpSyslogAppender udpAppender(udpClient, SYSLOG_SERVER, SYSLOG_PORT, DEVICE_HOSTNAME);
PrinterSyslogApender serialAppender(Serial);
Syslog syslog(APP_NAME, LOG_KERN, udpAppender, serialAppender);

// and use
syslog.log(LOG_INFO, "This is info log message");

arcao avatar Apr 17 '17 09:04 arcao

Would it be an Overkill to actually have the appenders register with delegates? This would allow runtime flexibility of adding and removing appenders.

Aside from this, thanks for including it as a milestone!

sle118 avatar Apr 19 '17 23:04 sle118

What you guys are very close to describing is a generic logging service (like log4j), in which syslog is merely one of many appenders, along with Serial, File, etc.

Several of these exist (albeit in various embryonic stages), but they all seem to fall short of actually being flexible enough to also handle syslogging.

Perhaps version 3 of this library will be the logging framework we've all been looking for?

kluzzebass avatar Nov 24 '17 09:11 kluzzebass