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 B Manikandan <ma...@wipro.com> on 2002/02/15 11:17:33 UTC
How to log a particular priority of a Category in a separate Appender
-Urgent
Hi,
I have my rootCategory as DEBUG.But for some Categories,certain
priorities alone need to be logged to a separate Appender.My property
file is....
log4j.rootCategory=DEBUG,fileLog
log4j.debug=true
#----------------------------------------------------------------------------
# fileLog configuration
# fileLog appender is set to be a DailyRollingFileAppender.
# the log file will be rolled over every month
# Truncate log file if it aleady exists.
#----------------------------------------------------------------------------
log4j.appender.fileLog=org.apache.log4j.DailyRollingFileAppender
log4j.appender.fileLog.File=/usr/log/rdw_debug.log
log4j.appender.fileLog.DatePattern='.'yyyy-MM
log4j.appender.fileLog.Append=false
log4j.appender.fileLog.layout=org.apache.log4j.PatternLayout
log4j.appender.fileLog.layout.ConversionPattern=%d{DATE} : %c
: %-5p : %m%n
#----------------------------------------------------------------------------
# Statistics Logging configuration.
#----------------------------------------------------------------------------
# Set the priority of the category named
"com.mizuho.rdw.processes.*" to
# LoggerPriority.STATISTICS, attach appender jms.
#----------------------------------------------------------------------------
log4j.category.com.mizuho.rdw.processes.*=STATISTICS,jms
log4j.appender.jms=org.apache.log4j.net.JMSAppender
STATISTICS is my own priority.For categories com.mizuho.rdw.processes.*,
I want to log STATISTICS priority alone in JMS.All other priorities of
the same categories have to go to a file as defined for rootCategory.How
do I achieve this.
Mani
Re: How to log a particular priority of a Category in a
separate Appender -Urgent
Posted by Ceki Gülcü <ce...@qos.ch>.
Start with the following first:
log4j.category.com.mizuho.rdw.processes=jms
At 15:47 15.02.2002 +0530, you wrote:
>Hi,
> I have my rootCategory as DEBUG.But for some Categories,certain
>priorities alone need to be logged to a separate Appender.My property
>file is....
>
> log4j.rootCategory=DEBUG,fileLog
> log4j.debug=true
>
>
>#----------------------------------------------------------------------------
>
> # fileLog configuration
> # fileLog appender is set to be a DailyRollingFileAppender.
> # the log file will be rolled over every month
> # Truncate log file if it aleady exists.
>
>#----------------------------------------------------------------------------
>
> log4j.appender.fileLog=org.apache.log4j.DailyRollingFileAppender
>
> log4j.appender.fileLog.File=/usr/log/rdw_debug.log
> log4j.appender.fileLog.DatePattern='.'yyyy-MM
> log4j.appender.fileLog.Append=false
> log4j.appender.fileLog.layout=org.apache.log4j.PatternLayout
> log4j.appender.fileLog.layout.ConversionPattern=%d{DATE} : %c
> : %-5p : %m%n
>
>#----------------------------------------------------------------------------
>
> # Statistics Logging configuration.
>
>#----------------------------------------------------------------------------
>
> # Set the priority of the category named
> "com.mizuho.rdw.processes.*" to
> # LoggerPriority.STATISTICS, attach appender jms.
>
>#----------------------------------------------------------------------------
>
> log4j.category.com.mizuho.rdw.processes.*=STATISTICS,jms
> log4j.appender.jms=org.apache.log4j.net.JMSAppender
>
>STATISTICS is my own priority.For categories com.mizuho.rdw.processes.*,
>I want to log STATISTICS priority alone in JMS.All other priorities of
>the same categories have to go to a file as defined for rootCategory.How
>do I achieve this.
>
>Mani
>
>
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
--
Ceki Gülcü
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>