diff options
author | Yann Ylavic <ylavic@apache.org> | 2023-03-14 15:37:00 +0100 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2023-03-14 15:37:00 +0100 |
commit | fffea3eb021ff0445ffedab12b5fceeb319a53cc (patch) | |
tree | 0d0b1caec8f21dc5f6e80efcba74cc56a5732ce7 /server | |
parent | util_time: Follow up to r1908383: ap_recent_ctime_ex() docx about trailing NUL. (diff) | |
download | apache2-fffea3eb021ff0445ffedab12b5fceeb319a53cc.tar.xz apache2-fffea3eb021ff0445ffedab12b5fceeb319a53cc.zip |
core: Use the main ErrorLogFormat for ap_log_perror() and while loading vhosts.
* server/core.c(create_core_server_config):
Init sconf->error_log_format early so that it applies while the vhost
is loading.
* server/log.c(log_error_core):
Get the core_server_config from the main server if no server/config is
provided.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908388 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r-- | server/core.c | 5 | ||||
-rw-r--r-- | server/log.c | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/server/core.c b/server/core.c index 75b25ac4e8..1e16f03a9e 100644 --- a/server/core.c +++ b/server/core.c @@ -493,6 +493,11 @@ static void *create_core_server_config(apr_pool_t *a, server_rec *s) conf->flush_max_pipelined = AP_FLUSH_MAX_PIPELINED; } else { + /* Use main ErrorLogFormat while the vhost is loading */ + core_server_config *main_conf = + ap_get_core_module_config(ap_server_conf->module_config); + conf->error_log_format = main_conf->error_log_format; + conf->flush_max_pipelined = -1; } diff --git a/server/log.c b/server/log.c index f3347d9834..6beb03a701 100644 --- a/server/log.c +++ b/server/log.c @@ -1098,6 +1098,9 @@ static void log_error_core(const char *file, int line, int module_index, errorlog_provider = ap_server_conf->errorlog_provider; errorlog_provider_handle = ap_server_conf->errorlog_provider_handle; } + + /* Use the main ErrorLogFormat if any */ + sconf = ap_get_core_module_config(ap_server_conf->module_config); } else { int configured_level = r ? ap_get_request_module_loglevel(r, module_index) : @@ -1145,6 +1148,10 @@ static void log_error_core(const char *file, int line, int module_index, } } } + else { + /* Use the main ErrorLogFormat if any */ + sconf = ap_get_core_module_config(ap_server_conf->module_config); + } } if (!logf && !(errorlog_provider && errorlog_provider_handle)) { @@ -1215,7 +1222,7 @@ static void log_error_core(const char *file, int line, int module_index, info.file = file; info.line = line; info.status = status; - log_format = sconf ? sconf->error_log_format : NULL; + log_format = sconf->error_log_format; done = 1; } |