Syslog-ng

From ArchWiki
Revision as of 01:47, 19 February 2010 by A neutrino (Talk | contribs) (how to make syslog-ng use ISO timestamps)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

ISO8601 timestamps

Before :

#logger These timestamps are not optimal.
#tail -n 1 /var/log/messages.log
Feb 18 14:25:01 hostname logger: These timestamps are not optimal.
#

Add

ts_format(iso);

to /etc/syslog-ng.conf in the options section. Example:

options {
  stats_freq (0);
  flush_lines (0);
  time_reopen (10);
  log_fifo_size (1000);
  long_hostnames(off); 
  use_dns (no);
  use_fqdn (no);
  create_dirs (no);
  keep_hostname (yes);
  perm(0640);
  group("log");
  ts_format(iso);      #make ISO8601 timestamps
};

Then :

#killall -HUP syslog-ng

After :

#logger Now THAT is a timestamp!
#tail -n 1 /var/log/messages.log
2010-02-18T20:23:58-05:00 electron logger: Now THAT is a timestamp!
#