Logger level being ignored

2007-05-23 Thread ben short

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Logger level being ignored

2007-05-23 Thread James Stauffer

Your configuration looks correct.  You could run with -Dlog4j.debug to
verify that is is being used.

On 5/23/07, ben short [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Logger level being ignored

2007-05-23 Thread ben short

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Logger level being ignored

2007-05-23 Thread James Stauffer

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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Logger level being ignored

2007-05-23 Thread Gallagher, Ron
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=falselevel
value=WARN//logger

Ron Gallagher, ATT Mobility

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Logger level being ignored

2007-05-23 Thread James Stauffer

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 [EMAIL PROTECTED] 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=falselevel
value=WARN//logger

Ron Gallagher, ATT Mobility

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Logger level being ignored

2007-05-23 Thread ben short

Im using spring with the following config in the web.xml.

context-param
   param-namelog4jConfigLocation/param-name
   param-value/WEB-INF/log4j.xml/param-value
   /context-param

   listener

listener-classorg.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 [EMAIL PROTECTED] 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 [EMAIL PROTECTED] 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=falselevel
 value=WARN//logger

 Ron Gallagher, ATT Mobility

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]