Link to home
Start Free TrialLog in
Avatar of tarakranjan
tarakranjan

asked on

Put Year in Linux Syslog

Hi Friends,,

How can i format syslog to put Year in the time stamp.


/\
-t
Avatar of Tintin
Tintin

You can't change the timestamp format with the default syslog.

You will need to use another syslog program like syslog-ng

You have to use syslog-nd for that.
Then edit the config file for syslog-ng (/etc/syslog-ng/syslog-ng.conf) add add the ts_format() option:

options {
        chain_hostnames(no);
        stats_freq(43200);
 
        # here you can specify the time format. iso includes the year
        ts_format(iso);
};

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ricardo Canani
Ricardo Canani
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Don't forget fo restart your syslog after changing syslog.conf
Avatar of tarakranjan

ASKER

got the solutions