Bug 50242

Summary: Sample log4j configuration does not match default JULI-based configuration
Product: Tomcat 7 Reporter: Christopher Schultz <chris>
Component: DocumentationAssignee: Tomcat Developers Mailing List <dev>
Severity: enhancement CC: poovensathish7
Priority: P2    
Version: trunk   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Sample log4j configuration that matches default java.util.logging configuration

Description Christopher Schultz 2010-11-09 16:38:19 UTC
The default configuration for JULI that ships with Tomcat is somewhat complex: it defines a number of handlers and maps application and server logging to each.

The sample configuration for log4j in the logging documentation is quite simple and just shoves everything into a single log file.

It would be nicer to include a sample configuration for log4j that mirrors the default one.
Comment 1 Mark Thomas 2010-11-09 16:57:39 UTC
Patches welcome
Comment 2 Christopher Schultz 2010-11-09 17:29:23 UTC
Created attachment 26274 [details]
Sample log4j configuration that matches default java.util.logging configuration

Patches provided
Comment 3 Mark Thomas 2010-11-10 07:22:50 UTC
Patch applied. Many thanks. It will be in  7.0.5 onwards.

I made one minor tweak, I left the default log level as INFO so it was consistent with the instructions further down for using DEBUG level logging.
Comment 4 Grzegorz Grzybek 2010-12-02 02:42:46 UTC
Here's my attempt to integrate Tomcat with SLF4J + Logback from the very beginning (Catalina.main()): https://github.com/grgrzybek/tomcat-slf4j-logback

It works for me and contains logback configuration matching the original J.U.L and Log4j herein.

Grzegorz Grzybek
Comment 5 Mark Thomas 2010-12-02 03:36:57 UTC
Please don't hijack similar but unrelated bugs. Anything added to an already resolved bug is almost certain to get ignored / lost.

Please create a new Enhancement request for the logback support.

It appears that this is a standalone project. Providing a patch in diff -u format against Tomcat trunk (model it on the log4j support in extras) would increase the chances of this being included in the standard Tomcat distribution.