Bug #45191 [Com]: error_log ignores date.timezone php.ini val when setting logging timestamps

From: Date: Thu, 30 Jun 2022 14:05:09 +0000
Subject: Bug #45191 [Com]: error_log ignores date.timezone php.ini val when setting logging timestamps
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-241842@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=45191&edit=1 ID: 45191 Comment by: bwbama85 at gmail dot com Reported by: info at organicdata dot co dot za Summary: error_log ignores date.timezone php.ini val when setting logging timestamps Status: Closed Type: Bug Package: Date/time related Operating System: Centos el5 PHP Version: 5.2CVS-2008-06-05 (snap) Assigned To: derick Block user comment: N Private report: N New Comment: This is still not functioning correctly in PHP 8.1.7. Literally PHP error_logs is the only location on the entire server where the logs always output in UTC no matter what settings are changed on the server itself or with date.timezone. Previous Comments: ------------------------------------------------------------------------ [2015-07-29 14:48:13] josh dot wieder at live dot com I've confirmed the same issue in PHP 5.4.16 using RHEL 7 (the latest stable version for the OS core repo). # grep -r "UTC" . ./httpd/php.log:[29-Jul-2015 00:31:20 UTC] [redacted] # cat /etc/php.ini |grep "York" date.timezone = America/New_York # cat /etc/php.ini |grep "error_log" error_log = /var/log/httpd/php.log This issue does not occur with logs generated directly by rsyslog. # cat /etc/rsyslog.conf |grep Template $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat # cat /etc/rsyslog.conf |grep log [...] cron.* /var/log/cron # tail cron Jul 29 10:30:01 [redacted] # date Wed Jul 29 10:38:09 EDT 2015 # timedatectl Local time: Wed 2015-07-29 10:40:22 EDT Universal time: Wed 2015-07-29 14:40:22 UTC RTC time: Wed 2015-07-29 14:40:21 Timezone: America/New_York (EDT, -0400) NTP enabled: yes NTP synchronized: yes Taking a look at main.c, I can see that references to strftime() have in fact been replaced with php_format_date(); despite this the issue remains. I am happy to take a closer look at this, however can anyone confirm if this has been resolved in more recent version? Again, I'm happy to put some work in but just want to check if anyone has resolved or confirmed this as resolved in a more recent version. ------------------------------------------------------------------------ [2012-07-20 11:28:40] rohgeo at gmail dot com Same problem here with PHP 5.4.5. ------------------------------------------------------------------------ [2012-07-17 09:54:40] rohgeo at gmail dot com php 5.4.4 all messages in /var/log/php_errors.log have UTC timestamps ------------------------------------------------------------------------ [2012-06-23 13:55:17] bram at ebskamp dot me Same problem here with PHP 5.4.3. ------------------------------------------------------------------------ [2012-05-30 07:32:57] rohgeo at gmail dot com php 5.4.3 all messages in /var/log/php_errors.log have UTC timestamps. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=45191 -- Edit this bug report at https://bugs.php.net/bug.php?id=45191&edit=1

« previous php.bugs (#241842) next »