1

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.

2

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
  • Tried that. Still logging in UTC. – Chad 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] – Chad 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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