From a3a14a9cde3c1aa5e82b69d796ee394dfdb84962 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 11 Jun 2019 23:13:43 +0900 Subject: [PATCH] Fix log-level is not set with cmd-line or configuration file --- src/shrpx.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shrpx.cc b/src/shrpx.cc index 5067d01c..2dd0493f 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -2898,6 +2898,8 @@ int process_options(Config *config, assert(include_set.empty()); } + Log::set_severity_level(config->logging.severity); + auto &loggingconf = config->logging; if (loggingconf.access.syslog || loggingconf.error.syslog) { @@ -3202,7 +3204,6 @@ void reload_config(WorkerProcess *wp) { // configuration can be obtained from get_config(). auto old_config = replace_config(std::move(new_config)); - Log::set_severity_level(get_config()->logging.severity); auto pid = fork_worker_process(ipc_fd, iaddrs); @@ -3210,7 +3211,6 @@ void reload_config(WorkerProcess *wp) { LOG(ERROR) << "Failed to process new configuration"; new_config = replace_config(std::move(old_config)); - Log::set_severity_level(get_config()->logging.severity); close_not_inherited_fd(new_config.get(), iaddrs); return;