commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: [Logging] Why Jdk14Logger contructor sets log level to INFO ?
Date Mon, 29 Apr 2002 15:30:49 GMT


On Mon, 29 Apr 2002, Christophe Felix-Henry wrote:

> Date: Mon, 29 Apr 2002 15:01:58 +0200
> From: Christophe Felix-Henry <cfelixhenry@scort.com>
> Reply-To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> To: commons-dev@jakarta.apache.org
> Subject: [Logging]  Why Jdk14Logger contructor sets log level to INFO ?
>
> I don't understand why Jdk14Logger overwrites the JDK1.4 logging
> configuration file settings.
> Here is the Jdk14Logger constructor:
>
>    public Jdk14Logger(String name) {
>
>         logger = Logger.getLogger(name);
>         logger.setUseParentHandlers(true);
>         logger.setLevel(Level.INFO);
>    }
>
> The java.util.logging.Logger should be configured with the config file
> settings.
> I think the two lines that sets properties should be removed.
>

I think you're right ... the basic contract for commons-logging is to not
mess with the configuration of the underlying logging system.

>
> I have an other problem with JDK1.4 logging. The name of the class that
> issued the logging request is always
> "org.apache.commons.logging.impl.Jdk14Logger". Is it possible to  work
> around this problem ?
>

What problem does this cause you?  If you use commons-logging to wrap JDK
1.4 logging (or any other logging implementation) the price you pay for
portability is the extra wrapper class.

If you really wanted to change it for some reason, you can always
implement your own LogFactory (using the provided APIs and factory
discovery mechanism) to return whatever you want.

> Christophe
>

Craig


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message