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. Regards Thomas > -----Ursprüngliche Nachricht----- > Von: Dr. Evil [mailto:[EMAIL PROTECTED]] > Gesendet: Donnerstag, 14. Februar 2002 05:41 > An: [EMAIL PROTECTED] > Betreff: Changing logging levels at runtime > > > > 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]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>