You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by ben short <ja...@gmail.com> on 2007/05/23 14:02:44 UTC

Logger level being ignored

Hi,

I have an application that uses the apache HTTPClient. With my
applications logging setup in debug mode the HTTPClient spits out lots
of info to the log file. I have setup a logger as shown in the
following log4j.xml, But it seems to be ignored and i see the following
in my log file. I also have a logger setup for the spring framework
which works fine. Can anyone see what if doing wrong? I'm using log4j
1.2.14.


10:23:11,714 DEBUG org.apache.commons.httpclient.Wire:69 - << "</div>[\r][\n]"
10:23:11,717 DEBUG org.apache.commons.httpclient.Wire:69 - << "[\r][\n]"
10:23:11,720 DEBUG org.apache.commons.httpclient.Wire:69 - << "<!--
SiteCatalyst code version: H.6.[\r][\n]"
10:23:11,724 DEBUG org.apache.commons.httpclient.Wire:69 - <<
"Copyright 1997-2006 Omniture, Inc. More info available at[\r][\n]"



<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration>

    <appender name="FILE" class="org.apache.log4j.RollingFileAppender">
		<param name="maxFileSize" value="128MB" />
		<param name="maxBackupIndex" value="5" />
		<param name="File" value="${catalina.home}/logs/jc_core.log" />
		<param name="threshold" value="DEBUG"/>
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d{ABSOLUTE} %5p %C:%L - %m%n" />
		</layout>
	</appender>


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

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


    <!--                           -->
    <!-- setup log4j's root logger -->
    <!--                           -->
    <root>
        <level value="all" />
        <appender-ref ref="FILE"/>
    </root>
</log4j:configuration>

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


Re: Logger level being ignored

Posted by James Stauffer <st...@gmail.com>.
With additivity set to false there should be no logs for
org.apache.commons.httpclient that make it to the appender.  I suspect
that something else is changing your config (maybe some code in a
library).

On 5/23/07, ben short <be...@benshort.co.uk> wrote:
> I just changed the logger configs to the following, but I still see
> the httpclient log messages.
>
> <logger name="org.springframework" additivity="false"><level
> value="WARN"/></logger>
>
>  <logger name="org.apache.commons.httpclient"
> additivity="false"><level value="WARN"/></logger>
>
> On 5/23/07, ben short <be...@benshort.co.uk> wrote:
> > Im using spring with the following config in the web.xml.
> >
> > <context-param>
> >         <param-name>log4jConfigLocation</param-name>
> >         <param-value>/WEB-INF/log4j.xml</param-value>
> >     </context-param>
> >
> >     <listener>
> >                 <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
> >         </listener>
> >
> > But I just tried commenting out that lot and putting the log4j.xml in
> > the class path. Same result.
> >
> > On 5/23/07, James Stauffer <st...@gmail.com> wrote:
> > > The level setting should allow only WARN and higher logs to get to the
> > > root logger even with additivity set to true.
> > >
> > > On 5/23/07, Gallagher, Ron <RG...@att.com> wrote:
> > > > Ben --
> > > >
> > > > Here's your problem:
> > > >
> > > > log4j: Setting [org.apache.commons.httpclient] additivity to [true].
> > > >
> > > > With the additivity of the org.apache.commons.httpclient logger set to
> > > > true, any logging output that is processed by the
> > > > org.apache.commons.httpclient will also be processed by any explicitly
> > > > configured loggers in it's ancestry, including the 'root' logger.
> > > >
> > > > To change this behavior, just set the additivity on the
> > > > org.apache.commons.httpclient to false.
> > > >
> > > > <logger name="org.apache.commons.httpclient" additivity="false"><level
> > > > value="WARN"/></logger>
> > > >
> > > > Ron Gallagher, AT&T Mobility
> > > >
> > > > -----Original Message-----
> > > > From: jamin.short@gmail.com [mailto:jamin.short@gmail.com] On Behalf Of
> > > > ben short
> > > > Sent: Wednesday, May 23, 2007 10:54 AM
> > > > To: Log4J Users List
> > > > Subject: Re: Logger level being ignored
> > > >
> > > > Heres my output with -Dlog4j.debug. Seems to show the correct setup of
> > > > the logger.
> > > >
> > > > log4j: Trying to find [log4j.properties] using
> > > > ClassLoader.getSystemResource().
> > > > log4j: Could not find resource: [null].
> > > > log4j:WARN No appenders could be found for logger
> > > > (org.apache.commons.digester.Digester.sax).
> > > > log4j:WARN Please initialize the log4j system properly.
> > > > log4j: System property is :null
> > > > log4j: Standard DocumentBuilderFactory search succeded.
> > > > log4j: DocumentBuilderFactory is:
> > > > org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
> > > > log4j: debug attribute= "null".
> > > > log4j: Ignoring debug attribute.
> > > > log4j: Threshold ="null".
> > > > log4j: Retreiving an instance of org.apache.log4j.Logger.
> > > > log4j: Setting [org.springframework] additivity to [true].
> > > > log4j: Level value for org.springframework is  [WARN].
> > > > log4j: org.springframework level set to WARN
> > > > log4j: Retreiving an instance of org.apache.log4j.Logger.
> > > > log4j: Setting [org.apache.commons.httpclient] additivity to [true].
> > > > log4j: Level value for org.apache.commons.httpclient is  [WARN].
> > > > log4j: org.apache.commons.httpclient level set to WARN
> > > > log4j: Level value for root is  [all].
> > > > log4j: root level set to ALL
> > > > log4j: Class name: [org.apache.log4j.RollingFileAppender]
> > > > log4j: Setting property [maxFileSize] to [128MB].
> > > > log4j: Setting property [maxBackupIndex] to [5].
> > > > log4j: Setting property [file] to
> > > > [/opt/apache-tomcat-5.5.23/logs/jc_core.log].
> > > > log4j: Setting property [threshold] to [DEBUG].
> > > > log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
> > > > log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %5p %C:%L -
> > > > %m%n].
> > > > log4j: setFile called: /opt/apache-tomcat-5.5.23/logs/jc_core.log, true
> > > > log4j: setFile ended
> > > > log4j: Adding appender named [FILE] to category [root].
> > > >
> > > > ---------------------------------------------------------------------
> > > > 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
> > > >
> > > >
> > >
> > >
> > > --
> > > James Stauffer        http://www.geocities.com/stauffer_james/
> > > Are you good? Take the test at http://www.livingwaters.com/good/
> > >
> > > ---------------------------------------------------------------------
> > > 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
>
>


-- 
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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


Re: Logger level being ignored

Posted by ben short <be...@benshort.co.uk>.
I just changed the logger configs to the following, but I still see
the httpclient log messages.

<logger name="org.springframework" additivity="false"><level
value="WARN"/></logger>

 <logger name="org.apache.commons.httpclient"
additivity="false"><level value="WARN"/></logger>

On 5/23/07, ben short <be...@benshort.co.uk> wrote:
> Im using spring with the following config in the web.xml.
>
> <context-param>
>         <param-name>log4jConfigLocation</param-name>
>         <param-value>/WEB-INF/log4j.xml</param-value>
>     </context-param>
>
>     <listener>
>                 <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
>         </listener>
>
> But I just tried commenting out that lot and putting the log4j.xml in
> the class path. Same result.
>
> On 5/23/07, James Stauffer <st...@gmail.com> wrote:
> > The level setting should allow only WARN and higher logs to get to the
> > root logger even with additivity set to true.
> >
> > On 5/23/07, Gallagher, Ron <RG...@att.com> wrote:
> > > Ben --
> > >
> > > Here's your problem:
> > >
> > > log4j: Setting [org.apache.commons.httpclient] additivity to [true].
> > >
> > > With the additivity of the org.apache.commons.httpclient logger set to
> > > true, any logging output that is processed by the
> > > org.apache.commons.httpclient will also be processed by any explicitly
> > > configured loggers in it's ancestry, including the 'root' logger.
> > >
> > > To change this behavior, just set the additivity on the
> > > org.apache.commons.httpclient to false.
> > >
> > > <logger name="org.apache.commons.httpclient" additivity="false"><level
> > > value="WARN"/></logger>
> > >
> > > Ron Gallagher, AT&T Mobility
> > >
> > > -----Original Message-----
> > > From: jamin.short@gmail.com [mailto:jamin.short@gmail.com] On Behalf Of
> > > ben short
> > > Sent: Wednesday, May 23, 2007 10:54 AM
> > > To: Log4J Users List
> > > Subject: Re: Logger level being ignored
> > >
> > > Heres my output with -Dlog4j.debug. Seems to show the correct setup of
> > > the logger.
> > >
> > > log4j: Trying to find [log4j.properties] using
> > > ClassLoader.getSystemResource().
> > > log4j: Could not find resource: [null].
> > > log4j:WARN No appenders could be found for logger
> > > (org.apache.commons.digester.Digester.sax).
> > > log4j:WARN Please initialize the log4j system properly.
> > > log4j: System property is :null
> > > log4j: Standard DocumentBuilderFactory search succeded.
> > > log4j: DocumentBuilderFactory is:
> > > org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
> > > log4j: debug attribute= "null".
> > > log4j: Ignoring debug attribute.
> > > log4j: Threshold ="null".
> > > log4j: Retreiving an instance of org.apache.log4j.Logger.
> > > log4j: Setting [org.springframework] additivity to [true].
> > > log4j: Level value for org.springframework is  [WARN].
> > > log4j: org.springframework level set to WARN
> > > log4j: Retreiving an instance of org.apache.log4j.Logger.
> > > log4j: Setting [org.apache.commons.httpclient] additivity to [true].
> > > log4j: Level value for org.apache.commons.httpclient is  [WARN].
> > > log4j: org.apache.commons.httpclient level set to WARN
> > > log4j: Level value for root is  [all].
> > > log4j: root level set to ALL
> > > log4j: Class name: [org.apache.log4j.RollingFileAppender]
> > > log4j: Setting property [maxFileSize] to [128MB].
> > > log4j: Setting property [maxBackupIndex] to [5].
> > > log4j: Setting property [file] to
> > > [/opt/apache-tomcat-5.5.23/logs/jc_core.log].
> > > log4j: Setting property [threshold] to [DEBUG].
> > > log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
> > > log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %5p %C:%L -
> > > %m%n].
> > > log4j: setFile called: /opt/apache-tomcat-5.5.23/logs/jc_core.log, true
> > > log4j: setFile ended
> > > log4j: Adding appender named [FILE] to category [root].
> > >
> > > ---------------------------------------------------------------------
> > > 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
> > >
> > >
> >
> >
> > --
> > James Stauffer        http://www.geocities.com/stauffer_james/
> > Are you good? Take the test at http://www.livingwaters.com/good/
> >
> > ---------------------------------------------------------------------
> > 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


Re: Logger level being ignored

Posted by ben short <be...@benshort.co.uk>.
Im using spring with the following config in the web.xml.

<context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>/WEB-INF/log4j.xml</param-value>
    </context-param>

    <listener>
		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
	</listener>

But I just tried commenting out that lot and putting the log4j.xml in
the class path. Same result.

On 5/23/07, James Stauffer <st...@gmail.com> wrote:
> The level setting should allow only WARN and higher logs to get to the
> root logger even with additivity set to true.
>
> On 5/23/07, Gallagher, Ron <RG...@att.com> wrote:
> > Ben --
> >
> > Here's your problem:
> >
> > log4j: Setting [org.apache.commons.httpclient] additivity to [true].
> >
> > With the additivity of the org.apache.commons.httpclient logger set to
> > true, any logging output that is processed by the
> > org.apache.commons.httpclient will also be processed by any explicitly
> > configured loggers in it's ancestry, including the 'root' logger.
> >
> > To change this behavior, just set the additivity on the
> > org.apache.commons.httpclient to false.
> >
> > <logger name="org.apache.commons.httpclient" additivity="false"><level
> > value="WARN"/></logger>
> >
> > Ron Gallagher, AT&T Mobility
> >
> > -----Original Message-----
> > From: jamin.short@gmail.com [mailto:jamin.short@gmail.com] On Behalf Of
> > ben short
> > Sent: Wednesday, May 23, 2007 10:54 AM
> > To: Log4J Users List
> > Subject: Re: Logger level being ignored
> >
> > Heres my output with -Dlog4j.debug. Seems to show the correct setup of
> > the logger.
> >
> > log4j: Trying to find [log4j.properties] using
> > ClassLoader.getSystemResource().
> > log4j: Could not find resource: [null].
> > log4j:WARN No appenders could be found for logger
> > (org.apache.commons.digester.Digester.sax).
> > log4j:WARN Please initialize the log4j system properly.
> > log4j: System property is :null
> > log4j: Standard DocumentBuilderFactory search succeded.
> > log4j: DocumentBuilderFactory is:
> > org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
> > log4j: debug attribute= "null".
> > log4j: Ignoring debug attribute.
> > log4j: Threshold ="null".
> > log4j: Retreiving an instance of org.apache.log4j.Logger.
> > log4j: Setting [org.springframework] additivity to [true].
> > log4j: Level value for org.springframework is  [WARN].
> > log4j: org.springframework level set to WARN
> > log4j: Retreiving an instance of org.apache.log4j.Logger.
> > log4j: Setting [org.apache.commons.httpclient] additivity to [true].
> > log4j: Level value for org.apache.commons.httpclient is  [WARN].
> > log4j: org.apache.commons.httpclient level set to WARN
> > log4j: Level value for root is  [all].
> > log4j: root level set to ALL
> > log4j: Class name: [org.apache.log4j.RollingFileAppender]
> > log4j: Setting property [maxFileSize] to [128MB].
> > log4j: Setting property [maxBackupIndex] to [5].
> > log4j: Setting property [file] to
> > [/opt/apache-tomcat-5.5.23/logs/jc_core.log].
> > log4j: Setting property [threshold] to [DEBUG].
> > log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
> > log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %5p %C:%L -
> > %m%n].
> > log4j: setFile called: /opt/apache-tomcat-5.5.23/logs/jc_core.log, true
> > log4j: setFile ended
> > log4j: Adding appender named [FILE] to category [root].
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
>
>
> --
> James Stauffer        http://www.geocities.com/stauffer_james/
> Are you good? Take the test at http://www.livingwaters.com/good/
>
> ---------------------------------------------------------------------
> 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


Re: Logger level being ignored

Posted by James Stauffer <st...@gmail.com>.
The level setting should allow only WARN and higher logs to get to the
root logger even with additivity set to true.

On 5/23/07, Gallagher, Ron <RG...@att.com> wrote:
> Ben --
>
> Here's your problem:
>
> log4j: Setting [org.apache.commons.httpclient] additivity to [true].
>
> With the additivity of the org.apache.commons.httpclient logger set to
> true, any logging output that is processed by the
> org.apache.commons.httpclient will also be processed by any explicitly
> configured loggers in it's ancestry, including the 'root' logger.
>
> To change this behavior, just set the additivity on the
> org.apache.commons.httpclient to false.
>
> <logger name="org.apache.commons.httpclient" additivity="false"><level
> value="WARN"/></logger>
>
> Ron Gallagher, AT&T Mobility
>
> -----Original Message-----
> From: jamin.short@gmail.com [mailto:jamin.short@gmail.com] On Behalf Of
> ben short
> Sent: Wednesday, May 23, 2007 10:54 AM
> To: Log4J Users List
> Subject: Re: Logger level being ignored
>
> Heres my output with -Dlog4j.debug. Seems to show the correct setup of
> the logger.
>
> log4j: Trying to find [log4j.properties] using
> ClassLoader.getSystemResource().
> log4j: Could not find resource: [null].
> log4j:WARN No appenders could be found for logger
> (org.apache.commons.digester.Digester.sax).
> log4j:WARN Please initialize the log4j system properly.
> log4j: System property is :null
> log4j: Standard DocumentBuilderFactory search succeded.
> log4j: DocumentBuilderFactory is:
> org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
> log4j: debug attribute= "null".
> log4j: Ignoring debug attribute.
> log4j: Threshold ="null".
> log4j: Retreiving an instance of org.apache.log4j.Logger.
> log4j: Setting [org.springframework] additivity to [true].
> log4j: Level value for org.springframework is  [WARN].
> log4j: org.springframework level set to WARN
> log4j: Retreiving an instance of org.apache.log4j.Logger.
> log4j: Setting [org.apache.commons.httpclient] additivity to [true].
> log4j: Level value for org.apache.commons.httpclient is  [WARN].
> log4j: org.apache.commons.httpclient level set to WARN
> log4j: Level value for root is  [all].
> log4j: root level set to ALL
> log4j: Class name: [org.apache.log4j.RollingFileAppender]
> log4j: Setting property [maxFileSize] to [128MB].
> log4j: Setting property [maxBackupIndex] to [5].
> log4j: Setting property [file] to
> [/opt/apache-tomcat-5.5.23/logs/jc_core.log].
> log4j: Setting property [threshold] to [DEBUG].
> log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
> log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %5p %C:%L -
> %m%n].
> log4j: setFile called: /opt/apache-tomcat-5.5.23/logs/jc_core.log, true
> log4j: setFile ended
> log4j: Adding appender named [FILE] to category [root].
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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


Re: Logger level being ignored

Posted by James Stauffer <st...@gmail.com>.
That all looks fine except I am not sure if lines 3-4 are ok.  Are you
using automatic config with log4j.xml in your classpath?  Are you sure
nothing else is configuring log4j?

On 5/23/07, ben short <be...@benshort.co.uk> wrote:
> Heres my output with -Dlog4j.debug. Seems to show the correct setup of
> the logger.
>
> log4j: Trying to find [log4j.properties] using ClassLoader.getSystemResource().
> log4j: Could not find resource: [null].
> log4j:WARN No appenders could be found for logger
> (org.apache.commons.digester.Digester.sax).
> log4j:WARN Please initialize the log4j system properly.
> log4j: System property is :null
> log4j: Standard DocumentBuilderFactory search succeded.
> log4j: DocumentBuilderFactory is:
> org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
> log4j: debug attribute= "null".
> log4j: Ignoring debug attribute.
> log4j: Threshold ="null".
> log4j: Retreiving an instance of org.apache.log4j.Logger.
> log4j: Setting [org.springframework] additivity to [true].
> log4j: Level value for org.springframework is  [WARN].
> log4j: org.springframework level set to WARN
> log4j: Retreiving an instance of org.apache.log4j.Logger.
> log4j: Setting [org.apache.commons.httpclient] additivity to [true].
> log4j: Level value for org.apache.commons.httpclient is  [WARN].
> log4j: org.apache.commons.httpclient level set to WARN
> log4j: Level value for root is  [all].
> log4j: root level set to ALL
> log4j: Class name: [org.apache.log4j.RollingFileAppender]
> log4j: Setting property [maxFileSize] to [128MB].
> log4j: Setting property [maxBackupIndex] to [5].
> log4j: Setting property [file] to [/opt/apache-tomcat-5.5.23/logs/jc_core.log].
> log4j: Setting property [threshold] to [DEBUG].
> log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
> log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %5p %C:%L - %m%n].
> log4j: setFile called: /opt/apache-tomcat-5.5.23/logs/jc_core.log, true
> log4j: setFile ended
> log4j: Adding appender named [FILE] to category [root].
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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


RE: Logger level being ignored

Posted by "Gallagher, Ron" <RG...@att.com>.
Ben --

Here's your problem:

log4j: Setting [org.apache.commons.httpclient] additivity to [true].

With the additivity of the org.apache.commons.httpclient logger set to
true, any logging output that is processed by the
org.apache.commons.httpclient will also be processed by any explicitly
configured loggers in it's ancestry, including the 'root' logger.

To change this behavior, just set the additivity on the
org.apache.commons.httpclient to false.  

<logger name="org.apache.commons.httpclient" additivity="false"><level
value="WARN"/></logger>

Ron Gallagher, AT&T Mobility

-----Original Message-----
From: jamin.short@gmail.com [mailto:jamin.short@gmail.com] On Behalf Of
ben short
Sent: Wednesday, May 23, 2007 10:54 AM
To: Log4J Users List
Subject: Re: Logger level being ignored

Heres my output with -Dlog4j.debug. Seems to show the correct setup of
the logger.

log4j: Trying to find [log4j.properties] using
ClassLoader.getSystemResource().
log4j: Could not find resource: [null].
log4j:WARN No appenders could be found for logger
(org.apache.commons.digester.Digester.sax).
log4j:WARN Please initialize the log4j system properly.
log4j: System property is :null
log4j: Standard DocumentBuilderFactory search succeded.
log4j: DocumentBuilderFactory is:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
log4j: debug attribute= "null".
log4j: Ignoring debug attribute.
log4j: Threshold ="null".
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.springframework] additivity to [true].
log4j: Level value for org.springframework is  [WARN].
log4j: org.springframework level set to WARN
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.apache.commons.httpclient] additivity to [true].
log4j: Level value for org.apache.commons.httpclient is  [WARN].
log4j: org.apache.commons.httpclient level set to WARN
log4j: Level value for root is  [all].
log4j: root level set to ALL
log4j: Class name: [org.apache.log4j.RollingFileAppender]
log4j: Setting property [maxFileSize] to [128MB].
log4j: Setting property [maxBackupIndex] to [5].
log4j: Setting property [file] to
[/opt/apache-tomcat-5.5.23/logs/jc_core.log].
log4j: Setting property [threshold] to [DEBUG].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %5p %C:%L -
%m%n].
log4j: setFile called: /opt/apache-tomcat-5.5.23/logs/jc_core.log, true
log4j: setFile ended
log4j: Adding appender named [FILE] to category [root].

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


Re: Logger level being ignored

Posted by ben short <be...@benshort.co.uk>.
Heres my output with -Dlog4j.debug. Seems to show the correct setup of
the logger.

log4j: Trying to find [log4j.properties] using ClassLoader.getSystemResource().
log4j: Could not find resource: [null].
log4j:WARN No appenders could be found for logger
(org.apache.commons.digester.Digester.sax).
log4j:WARN Please initialize the log4j system properly.
log4j: System property is :null
log4j: Standard DocumentBuilderFactory search succeded.
log4j: DocumentBuilderFactory is:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
log4j: debug attribute= "null".
log4j: Ignoring debug attribute.
log4j: Threshold ="null".
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.springframework] additivity to [true].
log4j: Level value for org.springframework is  [WARN].
log4j: org.springframework level set to WARN
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.apache.commons.httpclient] additivity to [true].
log4j: Level value for org.apache.commons.httpclient is  [WARN].
log4j: org.apache.commons.httpclient level set to WARN
log4j: Level value for root is  [all].
log4j: root level set to ALL
log4j: Class name: [org.apache.log4j.RollingFileAppender]
log4j: Setting property [maxFileSize] to [128MB].
log4j: Setting property [maxBackupIndex] to [5].
log4j: Setting property [file] to [/opt/apache-tomcat-5.5.23/logs/jc_core.log].
log4j: Setting property [threshold] to [DEBUG].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %5p %C:%L - %m%n].
log4j: setFile called: /opt/apache-tomcat-5.5.23/logs/jc_core.log, true
log4j: setFile ended
log4j: Adding appender named [FILE] to category [root].

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


Re: Logger level being ignored

Posted by James Stauffer <st...@gmail.com>.
Your configuration looks correct.  You could run with -Dlog4j.debug to
verify that is is being used.

On 5/23/07, ben short <ja...@gmail.com> wrote:
> Hi,
>
> I have an application that uses the apache HTTPClient. With my
> applications logging setup in debug mode the HTTPClient spits out lots
> of info to the log file. I have setup a logger as shown in the
> following log4j.xml, But it seems to be ignored and i see the following
> in my log file. I also have a logger setup for the spring framework
> which works fine. Can anyone see what if doing wrong? I'm using log4j
> 1.2.14.
>
>
> 10:23:11,714 DEBUG org.apache.commons.httpclient.Wire:69 - << "</div>[\r][\n]"
> 10:23:11,717 DEBUG org.apache.commons.httpclient.Wire:69 - << "[\r][\n]"
> 10:23:11,720 DEBUG org.apache.commons.httpclient.Wire:69 - << "<!--
> SiteCatalyst code version: H.6.[\r][\n]"
> 10:23:11,724 DEBUG org.apache.commons.httpclient.Wire:69 - <<
> "Copyright 1997-2006 Omniture, Inc. More info available at[\r][\n]"
>
>
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
> <log4j:configuration>
>
>     <appender name="FILE" class="org.apache.log4j.RollingFileAppender">
>                 <param name="maxFileSize" value="128MB" />
>                 <param name="maxBackupIndex" value="5" />
>                 <param name="File" value="${catalina.home}/logs/jc_core.log" />
>                 <param name="threshold" value="DEBUG"/>
>                 <layout class="org.apache.log4j.PatternLayout">
>                         <param name="ConversionPattern" value="%d{ABSOLUTE} %5p %C:%L - %m%n" />
>                 </layout>
>         </appender>
>
>
>     <logger name="org.springframework" ><level value="WARN"/></logger>
>
>     <logger name="org.apache.commons.httpclient" ><level value="WARN"/></logger>
>
>
>     <!--                           -->
>     <!-- setup log4j's root logger -->
>     <!--                           -->
>     <root>
>         <level value="all" />
>         <appender-ref ref="FILE"/>
>     </root>
> </log4j:configuration>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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