Version 0.1
syslogd-lite is a minimal replacement for the traditional syslog daemon, intended for use in small and embedded systems. It is particularly suitable for custom Raspberry Pi builds. Not only does it use a meagre amount of memory itself, it can be configured to maintain a fixed-size, rolling log file, so it uses little storage. This is particularly important if the system log file is on a temporary (RAM) filesystem, as the log file should never take up more than a fixed amount of storage. There should be no need to run a separate log rotation daemon, as older log entries automatically roll off.
Of course, the negative side of maintaining logs this way is that some logging will be lost if more log data is written than the program has been configured to store.
syslog-lite only supports logging from a local unix socket -- usually /dev/log. It does not accept any kind of network connection.
syslogd-lite works by maintaining in RAM a list of log messages of configurable size. The default size of the list is 100 messages, but this can be changed. When the list is full, older entries are deleted to make way for new ones.
At specific time intervals (defaulting to one minute) the list in memory is flushed to the log file -- usually /var/log/messages. A flush to file can be forced by sending the program the USR1 signal.
$ make $ sudo make install
syslogd-lite is designed to be started by some system startup script, or directly by init. It needs to start quite early in the boot sequence, else other processes started at boot will be unable to log. However, at the time syslogd is started, /dev and /var/tmp must exist, and be writable.
syslogd-lite is designed to run as root. Although it can be made to run as an unprivileged user with suitable choices of sockets and log files, extensive reconfiguration will probably be necessary for the rest of the system to recongize this change.
Log messages are written out exactly as they are received -- they are not processed in any way.
The longest log message that will be accepted is 2048 bytes -- this is the minimum required by the syslogd RFC. Longer messages than this will be truncated. Messages that take more than one socket packet to transmit will probably also be truncated.
syslogd-lite is probably only usable in custom Linux builds. Most mainstream Linux distributions, even for Raspberry Pi, use systemd, which has its own logging machinery.
It's probably best to disable, or not to run, log rotation daemons like logrotate, as syslogd-lite maintains a fixed size logfile, rotations of which are likely to be very confusing.
Distrubuted under the terms of the GNU Public Licence, v3.0