php - WordPress - How do I set error log timestamp timezone to local? -
wordpress uses utc / gmt timestamps in php error log. have timestamps in local server timezone. changing timezone in wp settings not help; affects time displays not timestamps in error log.
(i know there line in wp_settings.php file sets this, , given understand changing setting messes parts of wp code hardcoded utilize utc.)
i have looked @ overriding php error_log function parse time , replace it, 2 methods found required having installed (apd or runkit). understand it, these dev environments only, don't want mess them.
any suggestion on how wp write local timezone stamps error log?
there's reason logging time in utc. many time zones utilize daylight saving time. zones, there's hr in spring skipped, , hr in fall duplicated. if log using local time, there not easy way disambiguate between duplicated values.
for example, if in eastern time zone ("america/new_york") , logged using local time, value 2014-11-02 01:30:00 mean either 1:30 in eastern daylight time, or 1:30 in eastern standard time - hr later.
if log enough, might able observe comparing timestamps of other items in nearby log entries. in general, that's not great solution because might log occasionally, or might not want overhead of analyzing more 1 log entry @ time.
besides daylight saving time - there's issue if take log files multiple servers, should able compared uniformly. perhaps have web servers on east coast , west coast, 1 in europe, , 1 in japan. if there's spike in global traffic - shouldn't have time zone conversions line things up.
if must log in local time - consider including offset utc along timestamp. known "datetimeoffset" in languages, , part of iso-8601 standard. example, "2014-06-20t01:23:45-07:00". doing this, @ to the lowest degree allow conversion utc , remove ambiguity caused daylight saving time.
i don't know if there's specific way have wordpress or php log in manner, perhaps else can offer separate answer.
php wordpress timezone error-log
No comments:
Post a Comment