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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to