logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dr. Evil" <dre...@sidereal.kz>
Subject Changing logging levels at runtime
Date Thu, 14 Feb 2002 04:40:59 GMT

I have used log4j all through my Tomcat application.  It's great.  I
have debug commands everywhere that I need them.

The problem is that it generates a lot of logs, way too much logs for
use in a production environment.  I don't want to go through the code
and strip out all the cat.debug("") commands every time I do a
release.  I could try to set up something so it logs to a pipe with
some grep commands in it so I could filter out the DEBUG level
entries, but it would be enormously useful to be able to change a
configuration so that only WARN and higher level messages get logged,
without having to remove all the debug level commands.

I read through the docs and it seemed to sugest that this is
possible.  I tried to modify my log4j.properties file like this:

# Set root category priority to DEBUG and its only appender to A1.
log4j.rootCategory=WARN, A1
 
# A1 is set to be a ConsoleAppender.
#log4j.appender.A1=org.apache.log4j.ConsoleAppender
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

but it continues to log all messages, not just WARN messages.  Is
there a way to do this?

Thanks!

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