fat Sat, 29 Jan 2011 10:13:24 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=307841
Log: - Fixed bug #53777 (php-fpm log format now match php_error log format). Bug: http://bugs.php.net/53777 (Open) PHP-FPM error log date format is different from PHP error_log Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/sapi/fpm/fpm/zlog.c U php/php-src/trunk/sapi/fpm/fpm/zlog.c Modified: php/php-src/branches/PHP_5_3/NEWS =================================================================== --- php/php-src/branches/PHP_5_3/NEWS 2011-01-29 08:57:58 UTC (rev 307840) +++ php/php-src/branches/PHP_5_3/NEWS 2011-01-29 10:13:24 UTC (rev 307841) @@ -109,6 +109,7 @@ . Fixed bug #53527 (php-fpm --test doesn't set a valuable return value). (fat) . Enforce security in the fastcgi protocol parsing. (ef-lists at email dotde) + . Fixed bug #53777 (php-fpm log format now match php_error log format). (fat) - Readline extension: . Fixed bug #53630 (Fixed parameter handling inside readline() function). Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/zlog.c =================================================================== --- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/zlog.c 2011-01-29 08:57:58 UTC (rev 307840) +++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/zlog.c 2011-01-29 10:13:24 UTC (rev 307841) @@ -43,8 +43,11 @@ struct tm t; size_t len; - len = strftime(timebuf, timebuf_len, "%b %d %H:%M:%S", localtime_r((const time_t *) &tv->tv_sec, &t)); - len += snprintf(timebuf + len, timebuf_len - len, ".%06d", (int) tv->tv_usec); + len = strftime(timebuf, timebuf_len, "[%d-%b-%Y %H:%M:%S", localtime_r((const time_t *) &tv->tv_sec, &t)); + if (zlog_level == ZLOG_DEBUG) { + len += snprintf(timebuf + len, timebuf_len - len, ".%06d", (int) tv->tv_usec); + } + len += snprintf(timebuf + len, timebuf_len - len, "]"); return len; } /* }}} */ @@ -87,9 +90,9 @@ gettimeofday(&tv, 0); len = zlog_print_time(&tv, buf, buf_size); if (zlog_level == ZLOG_DEBUG) { - len += snprintf(buf + len, buf_size - len, " [%s] pid %d, %s(), line %d: ", level_names[flags & ZLOG_LEVEL_MASK], getpid(), function, line); + len += snprintf(buf + len, buf_size - len, " %s: pid %d, %s(), line %d: ", level_names[flags & ZLOG_LEVEL_MASK], getpid(), function, line); } else { - len += snprintf(buf + len, buf_size - len, " [%s] ", level_names[flags & ZLOG_LEVEL_MASK]); + len += snprintf(buf + len, buf_size - len, " %s: ", level_names[flags & ZLOG_LEVEL_MASK]); } if (len > buf_size - 1) { Modified: php/php-src/trunk/sapi/fpm/fpm/zlog.c =================================================================== --- php/php-src/trunk/sapi/fpm/fpm/zlog.c 2011-01-29 08:57:58 UTC (rev 307840) +++ php/php-src/trunk/sapi/fpm/fpm/zlog.c 2011-01-29 10:13:24 UTC (rev 307841) @@ -43,8 +43,11 @@ struct tm t; size_t len; - len = strftime(timebuf, timebuf_len, "%b %d %H:%M:%S", localtime_r((const time_t *) &tv->tv_sec, &t)); - len += snprintf(timebuf + len, timebuf_len - len, ".%06d", (int) tv->tv_usec); + len = strftime(timebuf, timebuf_len, "[%d-%b-%Y %H:%M:%S", localtime_r((const time_t *) &tv->tv_sec, &t)); + if (zlog_level == ZLOG_DEBUG) { + len += snprintf(timebuf + len, timebuf_len - len, ".%06d", (int) tv->tv_usec); + } + len += snprintf(timebuf + len, timebuf_len - len, "]"); return len; } /* }}} */ @@ -87,9 +90,9 @@ gettimeofday(&tv, 0); len = zlog_print_time(&tv, buf, buf_size); if (zlog_level == ZLOG_DEBUG) { - len += snprintf(buf + len, buf_size - len, " [%s] pid %d, %s(), line %d: ", level_names[flags & ZLOG_LEVEL_MASK], getpid(), function, line); + len += snprintf(buf + len, buf_size - len, " %s: pid %d, %s(), line %d: ", level_names[flags & ZLOG_LEVEL_MASK], getpid(), function, line); } else { - len += snprintf(buf + len, buf_size - len, " [%s] ", level_names[flags & ZLOG_LEVEL_MASK]); + len += snprintf(buf + len, buf_size - len, " %s: ", level_names[flags & ZLOG_LEVEL_MASK]); } if (len > buf_size - 1) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php