[syslog-ng] RFC3339 fractional second logging

Balazs Scheidler bazsi at balabit.hu
Fri Feb 10 10:35:56 CET 2006


On Thu, 2006-02-09 at 12:58 -0500, rlott at ivhs.com wrote:
> Thanks for getting back to me so quickly.  
> 
> Given that this is generated by syslog-ng itself, how would I then get
> syslog-ng to generate this info?  I saw that there is some code in
> logmsg.c that will do this if stamp->frac_present is true.  So, how
> does this flag get set to being true?  The self->date->str in
> log_msg_parse() also appears to determine whether there are fractional
> seconds available.

by using a template and including the received timestamp instead of the
one in the log message, e.g.

file("/var/log/messages" template("$R_ISODATE $HOST $MSG\n"));

Maybe I should add a keep_timestamp(yes|no) option that would be similar
to keep_hostname(), e.g. keep_timestamp(yes) would prefer to use the
timestamp that was sent by the peer, and keep_timestamp(no) would
regenerate the timestamp. This is an alternative solution, however it
might be nice to avoid having to write an explicit template for this
cases.

Any opinions?

-- 
Bazsi



More information about the syslog-ng mailing list