An Arduino library for logging to Syslog server via UDP
protocol in
IETF (RFC 5424) and BSD (RFC 3164) message format
How to use, see examples.
printf
-like formatting via logf
methods (use vsnprintf
method
inside)logMask
function,
see AdvancedLogging exampleUDP
astract class only.The library uses the Arduino UDP Network API (UDP
class) for interacting with
the underlying network hardware. This means it Just Works with a growing number
of boards and shields, including:
BridgeUDP
in place of EthernetUDP
, and
be sure to call a Bridge.begin()
firstThis library supports both Syslog message formats IETF (RFC 5424) and
BSD (RFC 3164). The newer IETF format is used by default. If you want to use
older "obsolete" BSD format, just specify it with SYSLOG_PROTO_BSD
constant
in a last constructor parameter.
Syslog syslog(udpClient, host, port, device_hostname, app_name, default_priority, SYSLOG_PROTO_BSD);
// or
Syslog syslog(udpClient, ip, port, device_hostname, app_name, default_priority, SYSLOG_PROTO_BSD);
// or
Syslog syslog(udpClient, SYSLOG_PROTO_BSD);
NILVALUE
(char -
) in TIMESTAMP
field, for BSD format the
TIMESTAMP
field is completely ommited. Syslog server should use a time
of receiving message in this case. It is OK in most cases. This issue will be
fixed in some of the next releases.