Bug 50242 - Sample log4j configuration does not match default JULI-based configuration
Summary: Sample log4j configuration does not match default JULI-based configuration
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Documentation (show other bugs)
Version: trunk
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-09 16:38 UTC by Christopher Schultz
Modified: 2021-04-01 11:49 UTC (History)
1 user (show)



Attachments
Sample log4j configuration that matches default java.util.logging configuration (3.99 KB, patch)
2010-11-09 17:29 UTC, Christopher Schultz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.

regards
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.