Ubuntu 12.04 – Change rsyslog to use EDT|EST instead of UTC

rsyslogtimetimezone

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.

Best 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