note 74420 added to function.syslog
| From: | adam_at_lockdownnetworks_dot_com at osu1 dot php dot net | Date: | Wed, 11 Apr 2007 01:32:04 +0000 |
| Subject: | note 74420 added to function.syslog | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125273@lists.php.net to get a copy of this message | ||
Be aware when using syslog() that if you set the timezone of environment to be something other than
the standard, syslog() may log the time to the log(s) with the wrong time zone information. For
example:
<?php
openlog('mylog', LOG_PID | LOG_ODELAY,LOG_LOCAL4);
putenv('TZ=UTC');
syslog(LOG_INFO, 'UTC Log line');
putenv('TZ=US/Pacific');
syslog(LOG_INFO, 'US/Pacific Log line');
closelog();
?>
Viewing the /usr/log/messages log will display these two lines:
Apr 11 01:25:39 hostname mylog[1400]: UTC Log line
Apr 10 18:25:39 hostname mylog[1400]: US/Pacific Log line
Adam.
----
Server IP: 64.71.164.2
Probable Submitter: 64.81.162.33
----
Manual Page -- http://www.php.net/manual/en/function.syslog.php
Edit -- https://master.php.net/note/edit/74420
Del: integrated -- https://master.php.net/note/delete/74420/integrated
Del: useless -- https://master.php.net/note/delete/74420/useless
Del: bad code -- https://master.php.net/note/delete/74420/bad+code
Del: spam -- https://master.php.net/note/delete/74420/spam
Del: non-english -- https://master.php.net/note/delete/74420/non-english
Del: in docs -- https://master.php.net/note/delete/74420/in+docs
Del: other reasons-- https://master.php.net/note/delete/74420
Reject -- https://master.php.net/note/reject/74420
Search -- https://master.php.net/manage/user-notes.php