]> granicus.if.org Git - php/commitdiff
- Fixed bug #45191 (error_log ignores date.timezone php.ini val when
authorDerick Rethans <derick@php.net>
Sun, 3 May 2009 19:08:28 +0000 (19:08 +0000)
committerDerick Rethans <derick@php.net>
Sun, 3 May 2009 19:08:28 +0000 (19:08 +0000)
  setting logging timestamps).

main/main.c

index 28a54de94e1afe851f7a5cbe3887f5745ba64a1f..9f23a06fca8453f61915525f387791a5b5383b6d 100644 (file)
@@ -612,7 +612,6 @@ static int module_shutdown = 0;
 PHPAPI void php_log_err(char *log_message TSRMLS_DC)
 {
        int fd = -1;
-       char error_time_str[128];
        struct tm tmbuf;
        time_t error_time;
 
@@ -628,14 +627,17 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC)
                if (fd != -1) {
                        char *tmp;
                        int len;
+                       char *error_time_str;
+
                        time(&error_time);
-                       strftime(error_time_str, sizeof(error_time_str), "%d-%b-%Y %H:%M:%S", php_localtime_r(&error_time, &tmbuf));
+                       error_time_str = php_format_date("d-M-Y H:i:s", 11, error_time, 1 TSRMLS_CC);
                        len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str, log_message, PHP_EOL);
 #ifdef PHP_WIN32
                        php_flock(fd, 2);
 #endif
                        write(fd, tmp, len);
                        efree(tmp);
+                       efree(error_time_str);
                        close(fd);
                        return;
                }