tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric B." <>
Subject Re: How to enable containerLog for one particular class only?
Date Sat, 08 Aug 2009 02:51:40 GMT
"Mark Thomas" <> wrote in message
> Eric B. wrote:
>> Hi,
>> I'm trying to understand how to enable some logging for a particular 
>> class.
>> In org.apache.catalina.realm.JNDIRealm, there are log messages written 
>> using
>> containerLog.trace().  While I understand this means that if the trace 
>> level
>> is selected for the containerLog, the message will be displayed.
>> My concern, of course, is that if I enable trace msgs on the container, I
>> will be blasted by thousands of log lines, and be unable to find the ones
>> that I really want belonging to JNDIRealm.  Not to mention that the 
>> system
>> will crawl to a halt with all the debug information being printed.
>> Is there a way I can enable the containerLog trace level but for that one
>> particular class only?
> It will be one of:
> org.apache.catalina.core.ContainerBase.[<enginename>]
> org.apache.catalina.core.ContainerBase.[<enginename>].[<hostname>]
> org.apache.catalina.core.ContainerBase.[<enginename>].[<hostname>].[/contextpath]
> depending on where you define the Realm.

Right.  But if I define the realm at the engine level, for example, and want 
to see the output of the realm, I would need to enable trace logging for
org.apache.catalina.core.ContainerBase.[<enginename>].  Holy cow, that'll be 
an enormous amount of data being logged, when really I only want trace 
logging for the JNDIRealm, and regular info for the rest.  I've tried 
enabling logging on the JNDIRealm class by itself, but since it uses the 
containerLog logger, I don't seem to be able to control that.

So, unless I miss my guess, my only options would be to enable trace logging 
for the entire engine or not get any trace logging from the JNDIRealm.  Is 
there no middle ground to be able to enable trace logging only for the 
JNDIRealm within the particular container?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message