Re: [PATCH] fpm/bug: handle custom log_level when not daemonized
| From: | Jérôme Loyet | Date: | Sun, 13 Dec 2009 17:18:56 +0000 |
| Subject: | Re: [PATCH] fpm/bug: handle custom log_level when not daemonized | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-46406@lists.php.net to get a copy of this message | ||
Le 13 décembre 2009 17:19, Jérôme Loyet <jerome@loyet.net> a écrit :
> Hi tony,
>
> There is a small bug when fpm is not daemonized. In this case, the
> log_level is not set and the default (notice) is used. When the
> damonize option is used, it works well.
>
> The patch attached corrects it.
With the correct version of the patch (.txt extension).
>
> Hope it helps
> ++ Jerome
>
Index: sapi/fpm/fpm/fpm_stdio.c =================================================================== --- sapi/fpm/fpm/fpm_stdio.c (révision 292067) +++ sapi/fpm/fpm/fpm_stdio.c (copie de travail) @@ -41,6 +41,7 @@ int fpm_stdio_init_final() /* {{{ */ { + zlog_set_level(fpm_globals.log_level); if (fpm_global_config.daemonize) { if (fpm_globals.error_log_fd != STDERR_FILENO) { /* there might be messages to stderr from libevent, we need to log them all */ @@ -49,7 +50,6 @@ return -1; } } - zlog_set_level(fpm_globals.log_level); zlog_set_fd(fpm_globals.error_log_fd); } return 0;
Index: sapi/fpm/fpm/fpm_stdio.c =================================================================== --- sapi/fpm/fpm/fpm_stdio.c (révision 292067) +++ sapi/fpm/fpm/fpm_stdio.c (copie de travail) @@ -41,6 +41,7 @@ int fpm_stdio_init_final() /* {{{ */ { + zlog_set_level(fpm_globals.log_level); if (fpm_global_config.daemonize) { if (fpm_globals.error_log_fd != STDERR_FILENO) { /* there might be messages to stderr from libevent, we need to log them all */ @@ -49,7 +50,6 @@ return -1; } } - zlog_set_level(fpm_globals.log_level); zlog_set_fd(fpm_globals.error_log_fd); } return 0;