summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2009-05-03 19:08:49 +0000
committerDerick Rethans <derick@php.net>2009-05-03 19:08:49 +0000
commit65fc90414390f62441ba8ba0ce177fbf6dbe60ec (patch)
tree5bd88ec2a88f105cf4c234906e635c06dff2f093
parent20a359a3fb97410f8ff0206b20661c7d4f6d7c77 (diff)
downloadphp-git-65fc90414390f62441ba8ba0ce177fbf6dbe60ec.tar.gz
- MFH: Fixed bug #45191 (error_log ignores date.timezone php.ini val when
setting logging timestamps).
-rw-r--r--main/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/main.c b/main/main.c
index 63ca21887f..28362578e3 100644
--- a/main/main.c
+++ b/main/main.c
@@ -520,7 +520,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;
@@ -536,14 +535,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;
}