diff options
author | Jérôme Loyet <fat@php.net> | 2011-07-05 18:09:07 +0000 |
---|---|---|
committer | Jérôme Loyet <fat@php.net> | 2011-07-05 18:09:07 +0000 |
commit | c4b7abb4ea29f5412cdd6f0e0da3419ece30fcec (patch) | |
tree | e49ff1b4ad808cb8532b11ed2718a6e448bad66f | |
parent | 987c843674a7af7a9c5da018e4470469131d704a (diff) | |
download | php-git-c4b7abb4ea29f5412cdd6f0e0da3419ece30fcec.tar.gz |
- Fixed wrong value of log_level when invoking fpm with -tt
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | sapi/fpm/fpm/fpm_conf.c | 2 | ||||
-rw-r--r-- | sapi/fpm/fpm/zlog.c | 10 | ||||
-rw-r--r-- | sapi/fpm/fpm/zlog.h | 2 |
4 files changed, 11 insertions, 4 deletions
@@ -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 diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c index 7fe27eda5e..6a37ae27f4 100644 --- a/sapi/fpm/fpm/fpm_conf.c +++ b/sapi/fpm/fpm/fpm_conf.c @@ -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); diff --git a/sapi/fpm/fpm/zlog.c b/sapi/fpm/fpm/zlog.c index e45f5c5379..6b062eb8ae 100644 --- a/sapi/fpm/fpm/zlog.c +++ b/sapi/fpm/fpm/zlog.c @@ -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]; } /* }}} */ diff --git a/sapi/fpm/fpm/zlog.h b/sapi/fpm/fpm/zlog.h index 598c075e35..a83e329023 100644 --- a/sapi/fpm/fpm/zlog.h +++ b/sapi/fpm/fpm/zlog.h @@ -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); |