[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4j-user
Subject:    RE: How to suppress log4j internal debug output
From:       "Armstrong, Timothy" <armstrt1 () anz ! com>
Date:       2005-11-22 19:22:02
Message-ID: C3B6F51AF0EFAF418BA6205522CFFB9302D8AA8E () exgau055csm01 ! oceania ! corp ! anz ! com
[Download RAW message or body]

Ok thanks. As suggested I applied warn to the root level logger. I agree it makes sense to do so.

Thanks
Tim A

-----Original Message-----
From: Jacob Kjome [mailto:hoju@visi.com]
Sent: Tuesday, 22 November 2005 8:21 AM
To: Log4J Users List
Subject: Re: How to suppress log4j internal debug output



Log4j-1.3 uses itself for logging.  You set the root logger to "debug".  Given
that, any library that uses log4j or commons-logging wrapping Log4j will log to
the debug level.  Try adding...

    <logger name="org.apache.log4j">
        <level value="WARN"/>
    </logger>

That said, it probably makes more sense to apply "warn" to the root logger and
specify "debug" to any specific logger [hierarchy] for which you want debuging
turned on.  Otherwise, you are going to have to individually turn off debugging
for every library that you don't want debug output.  It's much more manageable
to turn debugging on for the specific loggers from which you actually want to
see debugging output than vice-versa.

Jake

Quoting "Armstrong, Timothy" <armstrt1@anz.com>:

> I'm a new user of log4j and I'm having trouble suppressing the log4j internal
> debugging output.
>
> I'm using log4j-1.3alpha7 running under Java 1.5.0_03 on Win2k.
>
> I'm getting the following output
> 2005-11-22 07:27:16.407 -      main DEBUG - Ignoring debug attribute.
> 2005-11-22 07:27:16.422 -      main DEBUG - About to instantiate appender of
> type [org.apache.log4j.FileAppender]
> 2005-11-22 07:27:16.422 -      main DEBUG - Appender named as [WMCubed]
> 2005-11-22 07:27:16.422 -      main DEBUG - Pushing appender on to the object
> stack.
> ..................
> 2005-11-22 07:27:16.516 -      main DEBUG - Finished parsing.
>
> Using the following code:
> public class mainThread extends Thread
> {
>     private static final JoranConfigurator joranConfig = new
> JoranConfigurator();
>     ............
>     public static void main(String[] args) throws InterruptedException
>     {
>         joranConfig.doConfigure("C:\\WMCubed\\Config\\WM3LocalAgent.xml",
> LogManager.getLoggerRepository());
>     ............
>
> With the following configuration file
> <?xml version="1.0" encoding="UTF-8"?>
> <log4j:configuration debug="false"
> xmlns:log4j="http://jakarta.apache.org/log4j/">
>     <appender name="WMCubed" class="org.apache.log4j.FileAppender">
>         <param name="File" value="C:\\WMCubed\Logs\WM3LocalAgent.log"/>
>         <param name="Append" value="false"/>
>         <layout class="org.apache.log4j.PatternLayout">
>             <param name="ConversionPattern" value="%d{yyyy-MM-dd
> HH:mm:ss.SSS} - %9t %5p - %m%n"/>
>         </layout>
>     </appender>
>     <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
>         <layout class="org.apache.log4j.PatternLayout">
>             <param name="ConversionPattern" value="%d{yyyy-MM-dd
> HH:mm:ss.SSS} - %9t %5p - %m%n"/>
>         </layout>
>     </appender>
>     <logger name="nsd.wmcubed" additivity="false">
>         <level value="debug"/>
>         <appender-ref ref="WMCubed"/>
>     </logger>
>     <root>
>         <level value="debug"/>
>         <appender-ref ref="STDOUT"/>
>     </root>
> </log4j:configuration>
>
> And cannot work out how to stop log4j from starting up in internal debug
> mode.
>
> Regards
> Tim A
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic