Bug 51758 - Setting logger-specific overrides in logging.properties not working
Setting logger-specific overrides in logging.properties not working
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
7.0.14
PC Linux
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2011-09-02 11:44 UTC by Glen Mazza
Modified: 2011-09-21 12:58 UTC (History)
0 users



Attachments
2011-09-10_tc6_bug51758.patch (2.52 KB, patch)
2011-09-09 23:39 UTC, Konstantin Kolinko
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Glen Mazza 2011-09-02 11:44:29 UTC
Logger-specific configuration is being ignored in the $CATALINA_HOME/conf/logging.properties file.

Problem was asked (and unanswered) here, and googling did not turn up a solution either:
http://old.nabble.com/Having-difficulty-suppressing-the-org.apache.tomcat.util.digester.Digester-logger-to32367312.html

Steps to reproduce:

1.) Set the global logging level to FINE:

.level = FINE

2.) Add a logger-specific logging level override:

org.apache.tomcat.util.digester.Digester.level = INFO (or SEVERE)

3.) Start up Tomcat and view the catalina-(date).log file or catalina.out.  You'll see the above logger outputting countless FINE messages -- its output is not being suppressed despite the statement in #2 above.
Comment 1 Mark Thomas 2011-09-02 15:01:00 UTC
The logger name is not the same as the class name in that one case. The work-around is to define the level for:
org.apache.commons.digester.Digester.level = INFO
Comment 2 Mark Thomas 2011-09-02 15:04:45 UTC
This has been fixed in trunk and 7.0.x and will be included in 7.0.22 onwards.
Comment 3 Glen Mazza 2011-09-02 16:12:15 UTC
Thanks.  I'll use the workaround but what is the fix in 7.0.22+ , did you rename the logger back to the actual class name (org.apache.commons.digester.Digester) or put in special coding for "org.apache.tomcat.util.digester.Digester" to be understood as org.apache.commons.digester.Digester?

It's unfortunate this particular logger had the mismatch, as it's obviously an extremely chatty logger one would immediately like to suppress as one moves to FINE or more granular logging levels--many others presumably can get tripped up on this.
Comment 4 Mark Thomas 2011-09-02 16:21:39 UTC
The logger was named to align with the class.
Comment 5 Konstantin Kolinko 2011-09-09 23:34:16 UTC
The fix in r1164567/r1164569 was incomplete. Improved by r1167394/r1167396.
Will be in 7.0.22.
Comment 6 Konstantin Kolinko 2011-09-09 23:39:48 UTC
Created attachment 27479 [details]
2011-09-10_tc6_bug51758.patch

Patch for 6.0.x
Comment 7 Konstantin Kolinko 2011-09-21 12:58:20 UTC
Fixed in 6.0 by r1173608 -- it will be in 6.0.34.