logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dr. Evil" <dre...@sidereal.kz>
Subject Re: AW: Changing logging levels at runtime
Date Thu, 14 Feb 2002 07:32:58 GMT
> Your log4j.properties looks OK for me.
> You have to reinitialize log4j to get rid of your DEBUG messages.
> 
> There are at least to ways to do this:
> 1) Restart Tomcat. ( Not good for production system).
> 2) Use a init Servlet for your webapps and initialize log4j with
> PropertyConfigurator.configureAndWatch or DOMConfigurator.configureAndWatch
> See API docs and user manual for details.

It's no problem for me to restart Tomcat.  I'll power cycle the
machine if it helps.  I'll do anything I need to do so that I can stop
getting DEBUG level messages, because the alternative is that I have
to go through the code and manually remove all the logging statements.
It seems that there must be a way of specifying this in the properties
file, but I can't find it.  I have restarted it a hundred times with
this config file:

# Set root category priority to DEBUG and its only appender to A1.
log4j.rootCategory=INFO, A1
 
log4j.threshold=INFO
log4j.disable=DEBUG
 
# where to append to
log4j.appender.A1=org.apache.log4j.FileAppender
 
# set up the filename
log4j.appender.A1.File=/tmp/test.log
 
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

and I still get logs full of DEBUG messages.  I read in the FAQ:

> What are Categories?
>
> The notion of categories lies at the heart of log4j. Categories define
> a hierarchy and give the programmer run-time control on which
> statements are printed or not.

so it sounds like this is something which should be possible.  Do I
need an XML config file?  Is there some patch I need to apply to
log4j?

Any tips would be welcome.  I also read through all the mailing list
archives and there were some threads on this issue, and I tried their
recomendations but none of it helps.

Thanks for any sugestions.

--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message