Even if you find another solution, I give an answer to others.
Modify the syslog configuration file (in Debian, for example: /etc/syslog-ng/syslog-ng.conf ).
Then declare a new template as follows:
template template_date_format {
template ("$ {YEAR} - $ {MONTH} - $ {DAY} $ {HOUR}: $ {MIN}: $ {SEC} $ {HOST} $ {MSGHDR} $ {MSG} \ n");
template_escape (no);
};
This is an example, but you can use different macros according to the syslog documentation related to user9645 answer.
After that, find in this configuration file all the files that you want to change the output format, and apply this template to them.
For example, I want to change the output format /var/log/auth.log , then I change:
destination d_auth {file ("/ var / log / auth.log"); }; to:
destination d_auth {file ("/ var / log / auth.log" template (template_date_format)); }; Then restart syslog ( service syslog-ng restart ) and try logging in to see the changes in auth.log .
vince source share