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 Michael Giroux <ml...@gmail.com> on 2006/05/17 00:11:18 UTC
appender configuration question
I would like to generate log entries to multiple appenders, and most
of the configuration for the appenders is common. I'm reading the
docs, and it appears that log.info() will be sent to all appenders in
a chain, but this isn't exactly what I want to doe.
BTW, can anyone point me to a good online reference to log4j.properties?
Example follows:
log4j.logger.com.myco.sales=INFO, sales
log4j.logger.com.myco.inventory=INFO,inventory
log4j.appender.sales=org.apache.log4j.RollingFileAppender
log4j.appender.inventory=org.apache.log4j.RollingFileAppender
log4j.appender.sales.Append=false
log4j.appender.inventory.Append=false
log4j.appender.sales.File=logs/sales.log
log4j.appender.inventory.File=logs/inventory.log
In the example here, both appenders use RollingFileAppender and Append=false.
Is there some way to configure this so that I could define these
common attributes once, and override only the file name?
For example:
log4j.logger.com.myco=INFO, myco
log4j.logger.com.myco.sales=INFO, sales
log4j.logger.com.myco.inventory=INFO,inventory
log4j.appender.myco=org.apache.log4j.RollingFileAppender
log4j.appender.myco.Append=false
log4j.appender.sales.File=logs/sales.log
log4j.appender.inventory.File=logs/inventory.log
Thanks,
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org