]> granicus.if.org Git - php/commitdiff
Removed pid in debug logs written by chrildren processes
authorJérôme Loyet <fat@php.net>
Mon, 20 Jun 2011 00:03:39 +0000 (00:03 +0000)
committerJérôme Loyet <fat@php.net>
Mon, 20 Jun 2011 00:03:39 +0000 (00:03 +0000)
sapi/fpm/fpm/zlog.c

index fe62fd5ce66dc3c4b39c95cef4809f74fb7e95e4..e45f5c53795989b486e1026d8d467427ceea4821 100644 (file)
@@ -93,7 +93,11 @@ void zlog_ex(const char *function, int line, int flags, const char *fmt, ...) /*
                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);
+               if (!fpm_globals.is_child) {
+                       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: %s(), line %d: ", level_names[flags & ZLOG_LEVEL_MASK], function, line);
+               }
        } else {
                len += snprintf(buf + len, buf_size - len, "%s: ", level_names[flags & ZLOG_LEVEL_MASK]);
        }