syslogd: add config option to include milliseconds in timestamps
authorPeter Korsgaard <peter@korsgaard.com>
Mon, 27 Jan 2020 14:36:41 +0000 (15:36 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 29 Jan 2020 12:56:36 +0000 (13:56 +0100)
commiteb7f9acda147543079f261753a11d2afa340fc5e
treecc9aefc903421664a3261a8c3d7fd6c405e8c414
parent020abc8856f94d6e355f4daa972ac75fb05ae113
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 <peter@korsgaard.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
sysklogd/syslogd.c