From: Ryan Bloom Date: Mon, 9 Oct 2000 23:35:12 +0000 (+0000) Subject: We need to flush all logs when the child exits. To do this, we just X-Git-Tag: APACHE_2_0_ALPHA_8~433 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=259a47bde747c08566930540426e94405b2e8f24;p=apache We need to flush all logs when the child exits. To do this, we just create a child_init hook, and use it to register a cleanup for child exit. PR: 6550 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86488 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index 543b3e20ed..271619d135 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -1149,6 +1149,10 @@ static void init_config_log(apr_pool_t *pc, apr_pool_t *p, apr_pool_t *pt, serve for (s = s->next; s; s = s->next) { open_multi_logs(s, p); } +} + +static void init_child(apr_pool_t *p, server_rec *s) +{ #ifdef BUFFERED_LOGS /* Now register the last buffer flush with the cleanup engine */ apr_register_cleanup(p, s, flush_all_logs, flush_all_logs); @@ -1157,6 +1161,7 @@ static void init_config_log(apr_pool_t *pc, apr_pool_t *p, apr_pool_t *pt, serve static void register_hooks(void) { + ap_hook_child_init(init_child,NULL,NULL,AP_HOOK_MIDDLE); ap_hook_open_logs(init_config_log,NULL,NULL,AP_HOOK_MIDDLE); ap_hook_log_transaction(multi_log_transaction,NULL,NULL,AP_HOOK_MIDDLE); }