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.

Right now, I have rsyslog handling a log for a PHP app. Well...I have PHP using rsyslog to do the logging. Currently, it logs time in UTC. I want it to log in EST/EDT as appropriate. How do I make that change?

For the record, the timezone is set correctly in PHP and on the OS. A point to note is that the OS is in a VM, although I don't know why that would make a difference as the host is also in EDT.

share|improve this question
add comment

1 Answer

syslog inherit time zone from the system so you should add desired TZ value to syslog process environment.

echo 'export TZ="EDT"' >> /etc/default/rsyslog
restart rsyslog
share|improve this answer
    
Tried that. Still logging in UTC. –  cwscribner Aug 24 '12 at 15:38
    
are you sure I've just tried an it works –  hostmaster Aug 24 '12 at 15:45
    
this is my output gist.github.com/3452240 –  hostmaster Aug 24 '12 at 15:56
    
date() shows the correct time. syslog does not. In the log file its still printing time like this: [24-Aug-2012 15:35:56 UTC] –  cwscribner Aug 24 '12 at 16:10
    
rsyslog actuialy doesn't print Time Zone in the log file. What is the name of the file you are talking about ? –  hostmaster Aug 24 '12 at 19:51
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.