You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by richardtandoh <ri...@yahoo.com> on 2003/04/11 11:46:24 UTC

Switching off/disabling Struts logging

Morning

I'm using Struts beta 3 with Log4J 1.2.7 and I'm struggling to switch 
off Struts' logging messages.

So far, I've tried to tell Struts to let Log4J handle logging, by 
adding a file called commons-logging.properties to my WEB-INF/classes 
directory which contains the following lines:
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.
Log4jFactory
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCa
tegoryLog 

I've then also tried to instruct Log4J to curtail the Struts error 
messages by adding the following lines to my log4j.properties file:
log4j.category.org.apache.commons.logging.impl.Log4JLogger=FATAL, A3, 
A6

Any guidance would be much appreciated.

TIA

rt.


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


RE: Switching off/disabling Struts logging

Posted by apachep2 <ap...@hotmail.com>.
Didn't work out for me, struts [info] is still showing up.

I think it is because struts rc1 was changed to use commons logging.
commons logging intuitively finds log4j's presence while some people
like me don't know how to make commons-logging and log4j working
together, more specifically how to configure commons-logging.

I love my log4j.

-----Original Message-----
From: Stephen Smithstone [mailto:skullboxhouse@lchost.co.uk] 
Sent: April 11, 2003 6:04 AM
To: Struts Users Mailing List
Subject: Re: Switching off/disabling Struts logging

Im using rc1 and all i do to turn off the struts logging is place a 
log4j.properties file in the WEB-INF/classes 

which contains the following

log4j.rootLogger = debug , stdout

log4j.appender.stdout = org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout = org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern = [ %c ] %m %n

log4j.logger.org.apache = warn <-- removes all org.apache to just remove
the 
struts set to org.apache.struts

log4j.logger.cirrus = warn

On Friday 11 April 2003 10:46 am, richardtandoh wrote:
> Morning
>
> I'm using Struts beta 3 with Log4J 1.2.7 and I'm struggling to switch
> off Struts' logging messages.
>
> So far, I've tried to tell Struts to let Log4J handle logging, by
> adding a file called commons-logging.properties to my WEB-INF/classes
> directory which contains the following lines:
> org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.
> Log4jFactory
> org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCa
> tegoryLog
>
> I've then also tried to instruct Log4J to curtail the Struts error
> messages by adding the following lines to my log4j.properties file:
> log4j.category.org.apache.commons.logging.impl.Log4JLogger=FATAL, A3,
> A6
>
> Any guidance would be much appreciated.
>
> TIA
>
> rt.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


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


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


Re: Switching off/disabling Struts logging

Posted by richardtandoh <ri...@yahoo.com>.
Stephen

Thanks for the help, but I'm afraid it didn't work - I actually tried 
similar in the past.  I don't know if this is a problem that is 
peculiar to beta 3.  The most annoying messages are to do with 
validation - the entire contents of my validation.xml file is printed 
to the console, due to logging messages in 
org.apache.commons.validator.ValidatorResources.  I know I could open 
it up and recompile, but that kind of defeats the purpose of having 
Log4J.

Richard

--- In struts@yahoogroups.com, Stephen Smithstone 
<sk...@l...> wrote:
> Im using rc1 and all i do to turn off the struts logging is place a 
> log4j.properties file in the WEB-INF/classes 
> 
> which contains the following
> 
> log4j.rootLogger = debug , stdout
> 
> log4j.appender.stdout = org.apache.log4j.ConsoleAppender
> 
> log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
> 
> log4j.appender.stdout.layout.ConversionPattern = [ %c ] %m %n
> 
> log4j.logger.org.apache = warn <-- removes all org.apache to just 
remove the 
> struts set to org.apache.struts
> 
> log4j.logger.cirrus = warn
> 
> On Friday 11 April 2003 10:46 am, richardtandoh wrote:
> > Morning
> >
> > I'm using Struts beta 3 with Log4J 1.2.7 and I'm struggling to 
switch
> > off Struts' logging messages.
> >
> > So far, I've tried to tell Struts to let Log4J handle logging, by
> > adding a file called commons-logging.properties to my WEB-
INF/classes
> > directory which contains the following lines:
> > 
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.
> > Log4jFactory
> > 
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCa
> > tegoryLog
> >
> > I've then also tried to instruct Log4J to curtail the Struts error
> > messages by adding the following lines to my log4j.properties 
file:
> > log4j.category.org.apache.commons.logging.impl.Log4JLogger=FATAL, 
A3,
> > A6
> >
> > Any guidance would be much appreciated.
> >
> > TIA
> >
> > rt.
> >
> >
> > ------------------------------------------------------------------
---
> > To unsubscribe, e-mail: struts-user-unsubscribe@j...
> > For additional commands, e-mail: struts-user-help@j...
> 
> 
> --------------------------------------------------------------------
-
> To unsubscribe, e-mail: struts-user-unsubscribe@j...
> For additional commands, e-mail: struts-user-help@j...


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


Re: Switching off/disabling Struts logging

Posted by Stephen Smithstone <sk...@lchost.co.uk>.
Im using rc1 and all i do to turn off the struts logging is place a 
log4j.properties file in the WEB-INF/classes 

which contains the following

log4j.rootLogger = debug , stdout

log4j.appender.stdout = org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout = org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern = [ %c ] %m %n

log4j.logger.org.apache = warn <-- removes all org.apache to just remove the 
struts set to org.apache.struts

log4j.logger.cirrus = warn

On Friday 11 April 2003 10:46 am, richardtandoh wrote:
> Morning
>
> I'm using Struts beta 3 with Log4J 1.2.7 and I'm struggling to switch
> off Struts' logging messages.
>
> So far, I've tried to tell Struts to let Log4J handle logging, by
> adding a file called commons-logging.properties to my WEB-INF/classes
> directory which contains the following lines:
> org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.
> Log4jFactory
> org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCa
> tegoryLog
>
> I've then also tried to instruct Log4J to curtail the Struts error
> messages by adding the following lines to my log4j.properties file:
> log4j.category.org.apache.commons.logging.impl.Log4JLogger=FATAL, A3,
> A6
>
> Any guidance would be much appreciated.
>
> TIA
>
> rt.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


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