Bug 55193 - ErrorLogFormat is ignored by some modules
Summary: ErrorLogFormat is ignored by some modules
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.5-HEAD
Hardware: All All
: P2 minor with 3 votes (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: ErrorMessage, PatchAvailable
Depends on:
Blocks:
 
Reported: 2013-07-03 14:02 UTC by Dave
Modified: 2013-07-05 20:00 UTC (History)
0 users



Attachments
Fall back to ap_server_conf for ErrorLogFormat (707 bytes, patch)
2013-07-03 14:02 UTC, Dave
Details | Diff
Fix ErrorLogFormat in ap_log_perror() (495 bytes, patch)
2013-07-05 19:58 UTC, Dave
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave 2013-07-03 14:02:09 UTC
Created attachment 30532 [details]
Fall back to ap_server_conf for ErrorLogFormat

Modules that do not provide s->module_config (such as mod_cgid) completely bypass any ErrorLogFormat directives and get the default error log format applied to all error messages generated by them.

Possible solution is to drop back to ap_server_conf->module_config where available (patch enclosed)
Comment 1 Dave 2013-07-05 19:39:14 UTC
Update to report: the bug applies to all logging that uses ap_log_perror().

ErrorLogFormat is not applied when using ap_log_perror(): no server_rec is passed to log_error_core(), meaning sconf is never set and therefore sconf->error_log_format not used.

Much more elegant solution than proposed patch is simply to supply ap_server_core inside ap_log_perror_() in server/log.c:

-    log_error_core(file, line, module_index, level, status, NULL, NULL, NULL,
+    log_error_core(file, line, module_index, level, status, ap_server_core, NULL, NULL,

(fixes for me)
Comment 2 Dave 2013-07-05 19:58:50 UTC
Created attachment 30551 [details]
Fix ErrorLogFormat in ap_log_perror()