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 "Haidri, Baquera" <ba...@fc.celera.com> on 2003/07/19 02:40:17 UTC

Question on configuration

Hi,

I'm using log4j to do the logging for my Struts webapp.  I'm getting a whole lot of Struts messages logged to my file and I only want the messages that my classes create.  I tried the following in my log4j.properties file:

#config file for logger
log4j.rootLogger=DEBUG, A1
log4j.appender.A1=org.apache.log4j.FileAppender
log4j.appender.A1.File=/u01/home/haidribb/classes/test_log4j.log
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=[%p] %d [%t] %c -- %m%n
log4j.logger.org=FATAL
log4j.logger.com.ab=DEBUG

so that only FATAL messages from Struts get logged (since struts is in the 'org' category).  However, I'm still getting everything down to DEBUG from Struts in my log file!  How do I turn off logging from the Struts package but keep logging from my classes?

Thanks much in advance!
Baq

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


RE: Question on configuration

Posted by Jason Friedlander <jf...@northwestern.edu>.
try putting something like this in; i'm not famililar with struts, but you
could use the same technique to filter the struts messages.

log4j.logger.com.myclass=DEBUG,Myclassappender

you could also define two different appenders so that messages from struts
and from your classes go to separate files if you so desire.

maybe the struts one would look something like:

log4j.logger.com.apache.whateverSTRUTSis=FATAL,strutsappender

it may also work to point them to the same appender, but i haven't tried it.

hth,

jason


-----Original Message-----
From: Haidri, Baquera [mailto:baquera.haidri@fc.celera.com]
Sent: Friday, July 18, 2003 6:40 PM
To: log4j-user@jakarta.apache.org
Subject: Question on configuration


Hi,

I'm using log4j to do the logging for my Struts webapp.  I'm getting a whole
lot of Struts messages logged to my file and I only want the messages that
my classes create.  I tried the following in my log4j.properties file:

#config file for logger
log4j.rootLogger=DEBUG, A1
log4j.appender.A1=org.apache.log4j.FileAppender
log4j.appender.A1.File=/u01/home/haidribb/classes/test_log4j.log
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=[%p] %d [%t] %c -- %m%n
log4j.logger.org=FATAL
log4j.logger.com.ab=DEBUG

so that only FATAL messages from Struts get logged (since struts is in the
'org' category).  However, I'm still getting everything down to DEBUG from
Struts in my log file!  How do I turn off logging from the Struts package
but keep logging from my classes?

Thanks much in advance!
Baq

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



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