Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My syslog configuration (the default CentOS 5.3 configuration) writes out time stamps that look like

Jan  1 00:00:00 message

I would like the timestamp to contain the year. Preferably it would look like

2010-01-01 00:00:00.000000 message

Is there any way to configure syslog to do this?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

CentOS 5.4 uses sysklogd by default, syslog-ng is not provided*.There is no mention of how to alter the date format in the syslog.conf manpage. rsyslog is available through the default repositories and, glancing at its manpage, it may do what you want.

*See Where can I find syslog-ng in Red Hat Enterprise Linux 5?

share|improve this answer
    
Hmm, it looks like this is the path I will have to go down. We don't have enough time to drop in rsyslog now, but I think it will work well for version 2.0. –  Chas. Owens Jan 15 '10 at 2:39
add comment

What version of syslog does CentOS use?

Syslog-NG will let you change the template to use $FULLDATE or $ISODATE which seems to do what you want.

Syslog-ng Mailing List documenting templates

share|improve this answer
    
An ISO date is pretty much what I am looking for. The version reported by syslogd -v is syslogd 1.4.1. –  Chas. Owens Jan 15 '10 at 0:33
1  
+1 for using syslog-ng over syslogd, much more powerful and flexible. –  Mike Pountney Jan 15 '10 at 0:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.