#45191 [NEW]: error_log ignores date.timezone php.ini val when setting logging timestamps
From: info at organicdata dot co dot za
Operating system: Centos el5
PHP version: 5.2CVS-2008-06-05 (snap)
PHP Bug Type: Date/time related
Bug description: error_log ignores date.timezone php.ini val when setting logging timestamps
Description:
------------
I've noticed that changing the default PHP timezone using either php.ini
date.timezone or date_default_timezone_set appears to have no effect on the
timestamp used for each entry PHP writes to the file set by php.ini value
error_log (when php.ini log_errors = On)
It seems to use the system timestamp regardless. I've done some searching
on the web but found nothing and am afraid I'm not sure whether a bug or by
design but it seems strange enough to submit here
Reproduce code:
---------------
php.ini
-------
log_errors = On
error_log = myerrors.log
mycode.php
----------
error_reporting(E_STRICT);
date_default_timezone_set("UTC");
SOMEBADCONSTANT
date_default_timezone_set("Africa/Johannesburg");
ANOTHERBADCONSTANT
resulting myerrors.log
----------------------
[06-Jun-2008 00:41:34] PHP Notice: Use of undefined constant
SOMEBADCONSTANT - assumed 'SOMEBADCONSTANT' in /prj/mycode.php on line 3
[06-Jun-2008 00:41:34] PHP Notice: Use of undefined constant
ANOTHERBADCONSTANT - assumed 'ANOTHERBADCONSTANT' in /prj/mycode.php on
line 5
Expected result:
----------------
As Africa/Johannesburg is 2 hours ahead of UTC, I would have expected the
second myerrors.log entry to read
[06-Jun-2008 02:41:34] PHP Notice: Use of undefined constant
ANOTHERBADCONSTANT - assumed 'ANOTHERBADCONSTANT' in /prj/mycode.php on
line 5
And even if the comment is that date_default_timezone_set has no effect, I
saw the same when changing date.timezone in php.ini
The error logging appears to ignore it completely and simply use the
system time
--
Edit bug report at http://bugs.php.net/?id=45191&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45191&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45191&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45191&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45191&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45191&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45191&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45191&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45191&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45191&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45191&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45191&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45191&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45191&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45191&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45191&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45191&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45191&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45191&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45191&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45191&r=mysqlcfg
Thread (19 messages)
- info at organicdata dot co dot za
- derick@php.net#45191 [Opn->Bgs]: error_log ignores date.timezone php.ini val when setting logging timestamps
- info at organicdata dot co dot za#45191 [Bgs]: error_log ignores date.timezone php.ini val when setting logging timestamps
- jani@php.net#45191 [Bgs->Opn]: error_log ignores date.timezone php.ini val when setting logging timestamps
- jani@php.net#45191 [Opn->Asn]: error_log ignores date.timezone php.ini val when setting logging timestamps
- derick@php.net#45191 [Asn]: error_log ignores date.timezone php.ini val when setting logging timestamps
- derick@php.net#45191 [Asn->Csd]: error_log ignores date.timezone php.ini val when setting logging timestamps
- wadkar at gmail dot comBug #45191 [Com]: error_log ignores date.timezone php.ini val when setting logging timestamps
- daniel dot caillibaud at sesamath dot netBug #45191 [Com]: error_log ignores date.timezone php.ini val when setting logging timestamps
- christopher at specialtyproduce dot comBug #45191 [Com]: error_log ignores date.timezone php.ini val when setting logging timestamps
- wadkar at gmail dot comBug #45191 [Com]: error_log ignores date.timezone php.ini val when setting logging timestamps
- php at sboxx dot orgBug #45191 [Com]: error_log ignores date.timezone php.ini val when setting logging timestamps
- rohgeo at gmail dot comBug #45191 [Com]: error_log ignores date.timezone php.ini val when setting logging timestamps
- bram at ebskamp dot meBug #45191 [Com]: error_log ignores date.timezone php.ini val when setting logging timestamps
- rohgeo at gmail dot comBug #45191 [Com]: error_log ignores date.timezone php.ini val when setting logging timestamps
- rohgeo at gmail dot comBug #45191 [Com]: error_log ignores date.timezone php.ini val when setting logging timestamps
- josh dot wieder at live dot comBug #45191 [Com]: error_log ignores date.timezone php.ini val when setting logging timestamps
- bwbama85 at gmail dot comBug #45191 [Com]: error_log ignores date.timezone php.ini val when setting logging timestamps
- michal at euro-net dot plBug #45191 [Com]: error_log ignores date.timezone php.ini val when setting logging timestamps