syslogd: add config option to include milliseconds in timestamps

For some use cases, having logs with more than 1 second accuracy can be
helpful.  Add an option to include milliseconds when adding a timestamp in
HH:MM:SS.mmm format, similar to syslog-ng with fraq_digits(3) or journalctl
-o short-precise.

For simplicity, abuse the remaining space in the buffer used by ctime to add
the millieconds (overwriting year).

function                                             old     new   delta
timestamp_and_log                                    401     448     +47

Signed-off-by: Peter Korsgaard <>
Signed-off-by: Denys Vlasenko <>
1 file changed