Return-Path: Delivered-To: apmail-jakarta-log4j-user-archive@apache.org Received: (qmail 16715 invoked from network); 14 Feb 2002 09:37:38 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 14 Feb 2002 09:37:38 -0000 Received: (qmail 19443 invoked by uid 97); 14 Feb 2002 09:37:45 -0000 Delivered-To: qmlist-jakarta-archive-log4j-user@jakarta.apache.org Received: (qmail 19426 invoked by uid 97); 14 Feb 2002 09:37:45 -0000 Mailing-List: contact log4j-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@jakarta.apache.org Received: (qmail 19415 invoked from network); 14 Feb 2002 09:37:44 -0000 Date: 14 Feb 2002 09:26:09 -0000 Message-ID: <20020214092609.9711.qmail@sidereal.kz> From: "Dr. Evil" To: log4j-user@jakarta.apache.org In-reply-to: <97D358403DCBD4119B1E00D0B71DBE593736C0@issrv01.iwka.de> (thomas.sauder@iwka.de) Subject: Re: AW: AW: Changing logging levels at runtime References: <97D358403DCBD4119B1E00D0B71DBE593736C0@issrv01.iwka.de> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Again, it doesn't need to work dynamicly. I can restart the server, reboot the machine, reinstall the OS, anything, it doesn't matter. I just want it to not log DEBUG level messages. I think I can turn off all logging by making it log to /dev/null, but it would be fantastic if it could log only some messages but not others... > here is the configuration of log4j on my local machine: > > -------------------- log4j.properties on D: ----------- > #all classes have priority debug > log4j.rootCategory=DEBUG,R > > #store all log information using the following appender > log4j.appender.R=org.apache.log4j.RollingFileAppender > > #store log information in the following file > log4j.appender.R.File=e:\\log4j.log > > #define the size of log files > log4j.appender.R.MaxFileSize=10000KB > > #define number of backup files > log4j.appender.R.MaxBackupIndex=10 > > #define layout for log information > log4j.appender.R.layout=org.apache.log4j.PatternLayout > > #define the conversion pattern > log4j.appender.R.layout.ConversionPattern=%d{DATE} [%t] %-5p %c:%M:%L - %m%n > Thanks for the sugestion. I tried that, setting log4j.rootCategory to INFO and restarted the server and it didn't prevent it from logging DEBUG events. I set it to OFF, and it still logs everything. The FAQ really makes it sound like being able to configure log4j by changing a config file is one of log4j's main advantages, but this doesn't seem to be possible. Please don't tell me that I need edit thousands of lines of source code to turn logging off... If this is how log4j works, are there some alternative packages that let me distinguish different severity categories? Or is there a bug in the log4j version I am using? It is version 1.1.3. I am running Sun's Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_02-b02), Java HotSpot(TM) Client VM (build 1.3.1_02-b02, mixed mode) under Redhat 7.2, on an AMD Duron system. Will this work? Btw, here is the code in my Listener that starts the logging: System.out.println("Starting the logger"); PropertyConfigurator.configure ("/usr/local/jakarta-tomcat-4.0.1/webapps/ROOT/WEB-INF/classes/log4j.properties"); I put it in a Listener, instead of a load-on-startup servlet, because I actually want logging to start before any servlets start, and so what I do is create a Listener to listen for a context initialization event, which is the first thing that the Tomcat user can access. Thanks for any help. It seems like it should be trivial to put in a line in a file that says "don't log DEBUG messages" but it doesn't seem to be so easy as that. -- To unsubscribe, e-mail: For additional commands, e-mail: