Adding year in the syslog message (linux) Adding year in the syslog message (linux) linux linux

Adding year in the syslog message (linux)


If you use rsyslog, it is easy. Refer to following:

  1. Modify /etc/rsyslog.conf to following:

    ...authpriv.*     /var/log/secure;RSYSLOG_FileFormat...
  2. And then asking rsyslog daemon to reload configuration:

    $ kill -HUP <pid of rsyslog daemon>

More reference :


syslog-ng has the ts_format() option to specify the default timestamp format for files. it is set to iso format by default, which includes the year.

you can also configure file formats using the template() option.


If your syslog respects RFC 3164 (The BSD Syslog Protocol), then you cannot configure it to record the year. Unless you have a modern syslog daemon that follows RFC 5424 (rsyslog or syslog-ng) you cannot do that.