From 9b63fc011ea648ab85d832b6cc49c43b02d297e1 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 24 Jul 2015 00:32:19 +0900 Subject: [PATCH] nghttpx: Open log files by default configuration --- src/shrpx.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/shrpx.cc b/src/shrpx.cc index 4c59167f..c17f604e 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -1601,6 +1601,10 @@ int main(int argc, char **argv) { create_config(); fill_default_config(); + // First open log files with default configuration, so that we can + // log errors/warnings while reading configuration files. + reopen_log_files(); + // We have to copy argv, since getopt_long may change its content. mod_config()->argc = argc; mod_config()->argv = new char *[argc]; @@ -2117,8 +2121,7 @@ int main(int argc, char **argv) { cmdcfgs.emplace_back(SHRPX_OPT_CERTIFICATE_FILE, argv[optind++]); } - // First open default log files to deal with errors occurred while - // parsing option values. + // Reopen log files using configurations in file reopen_log_files(); {