ASF Bugzilla – Attachment 23280 Details for
Bug 43502
Verify that log directories exist in httpd -t config test
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Checks error logs and custom logs for the main host
httpd-2.2.8-logconfigtest.patch (text/plain), 2.78 KB, created by
David Fraser
on 2009-02-19 06:10:26 UTC
(
hide
)
Description:
Checks error logs and custom logs for the main host
Filename:
MIME Type:
Creator:
David Fraser
Created:
2009-02-19 06:10:26 UTC
Size:
2.78 KB
patch
obsolete
>--- modules/loggers/mod_log_config.c.logconfigtest 2006-07-11 22:38:44.000000000 -0500 >+++ modules/loggers/mod_log_config.c 2009-02-19 07:35:18.000000000 -0600 >@@ -1496,6 +1496,59 @@ > > return OK; > } >+static void log_configtest(apr_pool_t *p, server_rec *s) >+{ >+ apr_status_t rc; >+ /* We check if we can at least open the error file. >+ */ >+ if ((rc = apr_file_open(&s->error_log, s->error_fname, APR_APPEND | APR_WRITE | APR_CREATE | APR_LARGEFILE, >+ APR_OS_DEFAULT, p)) != APR_SUCCESS) { >+ ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL, >+ "Could not open error log file %s.",s->error_fname); >+ } else { >+ apr_file_close(s->error_log); >+ } >+ /* We check if we can open the other files >+ */ >+ multi_log_state *mls = ap_get_module_config(s->module_config, &log_config_module); >+ config_log_state *clsarray; >+ int i; >+ >+ /* >+ * Log this transaction.. >+ */ >+ if (mls->config_logs->nelts) { >+ clsarray = (config_log_state *) mls->config_logs->elts; >+ for (i = 0; i < mls->config_logs->nelts; ++i) { >+ config_log_state *cls = &clsarray[i]; >+ const char *fname = cls->fname; >+ apr_file_t *logfile = NULL; >+ if ((rc = apr_file_open(&logfile, fname, APR_APPEND | APR_WRITE | APR_CREATE | APR_LARGEFILE, >+ APR_OS_DEFAULT, p)) != APR_SUCCESS) { >+ ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL, >+ "Could not open log file %s.",fname); >+ } else { >+ apr_file_close(logfile); >+ } >+ } >+ } >+ else if (mls->server_config_logs) { >+ clsarray = (config_log_state *) mls->server_config_logs->elts; >+ for (i = 0; i < mls->server_config_logs->nelts; ++i) { >+ config_log_state *cls = &clsarray[i]; >+ const char *fname = cls->fname; >+ apr_file_t *logfile = NULL; >+ if ((rc = apr_file_open(&logfile, fname, APR_APPEND | APR_WRITE | APR_CREATE | APR_LARGEFILE, >+ APR_OS_DEFAULT, p)) != APR_SUCCESS) { >+ ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL, >+ "Could not open log file %s.",fname); >+ } else { >+ apr_file_close(logfile); >+ } >+ } >+ } >+ >+} > > static void register_hooks(apr_pool_t *p) > { >@@ -1503,6 +1556,7 @@ > ap_hook_child_init(init_child,NULL,NULL,APR_HOOK_MIDDLE); > ap_hook_open_logs(init_config_log,NULL,NULL,APR_HOOK_MIDDLE); > ap_hook_log_transaction(multi_log_transaction,NULL,NULL,APR_HOOK_MIDDLE); >+ ap_hook_test_config(log_configtest,NULL,NULL,APR_HOOK_MIDDLE); > > /* Init log_hash before we register the optional function. It is > * possible for the optional function, ap_register_log_handler,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 43502
:
22281
|
23280
|
23281
|
23282