Bug 55193

Summary: ErrorLogFormat is ignored by some modules
Product: Apache httpd-2 Reporter: Dave <apache-b6e>
Component: CoreAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: minor Keywords: ErrorMessage, PatchAvailable
Priority: P2    
Version: 2.5-HEAD   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Fall back to ap_server_conf for ErrorLogFormat
Fix ErrorLogFormat in ap_log_perror()

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()