Return-Path: Delivered-To: apmail-jakarta-log4j-dev-archive@apache.org Received: (qmail 56799 invoked from network); 30 Jan 2002 07:45:20 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 30 Jan 2002 07:45:20 -0000 Received: (qmail 19204 invoked by uid 97); 30 Jan 2002 07:45:27 -0000 Delivered-To: qmlist-jakarta-archive-log4j-dev@jakarta.apache.org Received: (qmail 19180 invoked by uid 97); 30 Jan 2002 07:45:26 -0000 Mailing-List: contact log4j-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@jakarta.apache.org Received: (qmail 19163 invoked from network); 30 Jan 2002 07:45:26 -0000 Message-Id: <5.0.2.1.0.20020130082941.024be8d8@mail.qos.ch> X-Sender: cgu@mail.qos.ch X-Mailer: QUALCOMM Windows Eudora Version 5.0.2 Date: Wed, 30 Jan 2002 08:45:25 +0100 To: "Log4J Developers List" From: Ceki =?iso-8859-1?Q?G=FClc=FC?= Subject: Re: Proposal: Setting Level with BasicConfigurator In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Simon, The BasicConfigurator is just a way to get log4j to print something very quickly. For more flexibility you can configure log4j programmatically or use configuration files.=20 To set the level of the root logger to INFO level just do: Logger.getRootLogger().setLevel(Level.INFO); I feel very bad about rejecting your contribution but I am afraid that is the right thing to do.=20 At 08:10 28.01.2002 -0500, you wrote: >Proposal: > >What: Making the Log-Level of the root category manageable by the= BasicConfigurator > >How: Adding the methods=20 > configure(Level level) =20 > and=20 > configure(Appender appender, Level level) > >Why: In some cases it would be nice to turn of low level (for instance= DEBUG) loggings=20 > without or before using a config file. Enableing this in the= BasicConfigurator is=20 > more convenient for the Developer as going over the root Logger itself > Example 1: A small (Test?) project, where using a conf file is to much= overhead > Example 2: (A real case that brought me to change the code) > Imaging a project that uses a XML Config file to config the names= and pathes of > all the needed files (And of course some other stuff). One of these= files is the > Log4J conf file. Now this project uses some XML-Helper classes to= read the > programs config file which are also using Log4J logging.=20 > This leads to the case, that when we use only the BasicConfigurator= at the=20 > beginning, we get a lot of "debug" log statments out of the=20 > "read-the-xml-configfile-helper-classes" until we have extracted= the path=20 > of the Log4J conf file so we can use it. This is pretty annoying,= because I=20 > allready know my helper-classes are working and don't want to see= the debug > and info loggings. As a general rule, helper classes, libraries, non-top level components should not attempt to configure log4j. Configuring log4j is the responsibility of the end-user or generally the application deployer. Whenever possible, a library should not try to configure logging but leave it to the deployer. After all, logging output is useful only if someone will take the time to look at them. If the end-user wishes to log then she should control the logging configuration. Nevertheless, it is helpful if the library developper provides documentation on logging, preferably with working examples. -- Ceki G=FClc=FC -- To unsubscribe, e-mail: For additional commands, e-mail: