]> granicus.if.org Git - php/commitdiff
- Fixed wrong value of log_level when invoking fpm with -tt
authorJérôme Loyet <fat@php.net>
Tue, 5 Jul 2011 18:09:07 +0000 (18:09 +0000)
committerJérôme Loyet <fat@php.net>
Tue, 5 Jul 2011 18:09:07 +0000 (18:09 +0000)
NEWS
sapi/fpm/fpm/fpm_conf.c
sapi/fpm/fpm/zlog.c
sapi/fpm/fpm/zlog.h

diff --git a/NEWS b/NEWS
index 30e58fad7ac0c98faf8fdafe723c10f72f1c6a88..b6fc99a3f7eee981c6391db4c533924d4ed127fd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -34,6 +34,7 @@ PHP                                                                        NEWS
   . Fixed missing Expires and Cache-Control headers for ping and status pages.
     (fat)
   . Fixed memory leak. (fat) Reported and fixed by Giovanni Giacobbi.
+  . Fixed wrong value of log_level when invoking fpm with -tt. (fat)
 
 - SPL extension:
   . Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys
index 7fe27eda5e4df92bf7397883e4d89af65942e56b..6a37ae27f4f219df522eb5d31a95fcc0b9dc8213 100644 (file)
@@ -1151,7 +1151,7 @@ static void fpm_conf_dump() /* {{{ */
        zlog(ZLOG_NOTICE, "\tpid = %s",                         STR2STR(fpm_global_config.pid_file));
        zlog(ZLOG_NOTICE, "\tdaemonize = %s",                   BOOL2STR(fpm_global_config.daemonize));
        zlog(ZLOG_NOTICE, "\terror_log = %s",                   STR2STR(fpm_global_config.error_log));
-       zlog(ZLOG_NOTICE, "\tlog_level = %s",                   zlog_get_level_name());
+       zlog(ZLOG_NOTICE, "\tlog_level = %s",                   zlog_get_level_name(fpm_globals.log_level));
        zlog(ZLOG_NOTICE, "\tprocess_control_timeout = %ds",    fpm_global_config.process_control_timeout);
        zlog(ZLOG_NOTICE, "\temergency_restart_interval = %ds", fpm_global_config.emergency_restart_interval);
        zlog(ZLOG_NOTICE, "\temergency_restart_threshold = %d", fpm_global_config.emergency_restart_threshold);
index e45f5c53795989b486e1026d8d467427ceea4821..6b062eb8ae22fc5818a908b00a24e90481f00e52 100644 (file)
@@ -29,9 +29,15 @@ static const char *level_names[] = {
        [ZLOG_ALERT]            = "ALERT",
 };
 
-const char *zlog_get_level_name() /* {{{ */
+const char *zlog_get_level_name(int log_level) /* {{{ */
 {
-       return level_names[zlog_level];
+       if (log_level < 0) {
+               log_level = zlog_level;
+       } else if (log_level < ZLOG_DEBUG || log_level > ZLOG_ALERT) {
+               return "unknown value";
+       }
+
+       return level_names[log_level];
 }
 /* }}} */
 
index 598c075e35ef6dbe6f00d29742bb1a7de8fc9777..a83e329023e4a7fca79a49db26c0db70e593a2fe 100644 (file)
@@ -11,7 +11,7 @@ struct timeval;
 
 int zlog_set_fd(int new_fd);
 int zlog_set_level(int new_value);
-const char *zlog_get_level_name();
+const char *zlog_get_level_name(int log_level);
 void zlog_set_launched(void);
 
 size_t zlog_print_time(struct timeval *tv, char *timebuf, size_t timebuf_len);