You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Christophe Felix-Henry <cf...@scort.com> on 2002/04/29 15:01:58 UTC

[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 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 ?

Christophe



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Logging] Why Jdk14Logger contructor sets log level to INFO ?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

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

> Date: Mon, 29 Apr 2002 15:01:58 +0200
> From: Christophe Felix-Henry <cf...@scort.com>
> Reply-To: Jakarta Commons Developers List <co...@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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>