]> granicus.if.org Git - php/commitdiff
Fixed bug #68381 Set FPM log level earlier during init
authorDavid Zuelke <dzuelke@gmail.com>
Sat, 8 Nov 2014 22:22:54 +0000 (17:22 -0500)
committerRemi Collet <remi@php.net>
Tue, 18 Nov 2014 16:42:21 +0000 (17:42 +0100)
The log level will be ignored throughout log events in fpm_unix_init_main, until
the very end when zlog_set_level is finally called.

In particular, fpm_unix_conf_wp may throw notices like this:

> [08-Nov-2014 17:13:36] NOTICE: [pool www] 'user' directive is ignored when…

Which will still appear even if log_level in php-fpm.conf is set to warning+

sapi/fpm/fpm/fpm_unix.c

index ea0e67369cd534448894db87c1ab31a8b7ecad96..5dfdb4ab38c82850fb728994c5c09dec81d47692 100644 (file)
@@ -231,6 +231,8 @@ int fpm_unix_init_main() /* {{{ */
        struct fpm_worker_pool_s *wp;
        int is_root = !geteuid();
 
+       zlog_set_level(fpm_globals.log_level);
+
        if (fpm_global_config.rlimit_files) {
                struct rlimit r;
 
@@ -361,7 +363,6 @@ int fpm_unix_init_main() /* {{{ */
                }
        }
 
-       zlog_set_level(fpm_globals.log_level);
        return 0;
 }
 /* }}} */