In that case you only need two appenders and the set the additivity of the two categories to false. Try with that:

# Appender number 1 log4j.category.com.foo.bar.mycategory=debug,APPENDER_1 log4j.additivity.com.foo.bar.mycategory=false log4j.appender.APPENDER_1=org.apache.log4j.DailyRollingFileAppender log4j.appender.APPENDER_1=org.apache.log4j.RollingFileAppender log4j.appender.APPENDER_1.File=${logs_path}/myFile_1.log log4j.appender.APPENDER_1.layout=org.apache.log4j.PatternLayout log4j.appender.APPENDER_1.MaxBackupIndex=1 log4j.appender.APPENDER_1.MaxFileSize=10MB log4j.appender.APPENDER_1.layout.ConversionPattern=%t %d [%5p %c] - %m%n
# Appender number 1 log4j.category.com.foo.other.my_other_category=debug,APPENDER_2


log4j.additivity.com.foo.other.my_other_category=false

log4j.appender.APPENDER_2=org.apache.log4j.DailyRollingFileAppender

log4j.appender.APPENDER_2=org.apache.log4j.RollingFileAppender

log4j.appender.APPENDER_2.File=${logs_path}/myFile_2.log

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

log4j.appender.APPENDER_2.MaxBackupIndex=1

log4j.appender.APPENDER_2.MaxFileSize=10MB

log4j.appender.APPENDER_2.layout.ConversionPattern=%t %d [%5p %c] - %m%n


Wade Chandler wrote:

Jos� Antonio P�rez Testa wrote:

Do you mean to have package com.foo.bar logging to file1.log and com.foo.other logging to another file?

Wade Chandler wrote:

Does anyone know if it is possible to have an appender setup to only output from certain packages? I would like to be able to log to a seperate file for different packages in Log4j.

Thanks for any input.

Wade


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

-------------------------------------------------------------------------------------------------------------------

Este correo electr�nico y, en su caso, cualquier fichero anexo al mismo, contiene informaci�n de car�cter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgaci�n, copia o distribuci�n a terceros sin la previa autorizaci�n escrita de Indra. En el caso de haber recibido este correo electr�nico por error, se ruega notificar inmediatamente esta circunstancia mediante reenv�o a la direcci�n electr�nica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail

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




That is exactly what I would like to be able to do. Thanks for the reply.


Wade


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

-------------------------------------------------------------------------------------------------------------------
Este correo electr�nico y, en su caso, cualquier fichero anexo al mismo, contiene 
informaci�n de car�cter confidencial exclusivamente dirigida a su destinatario o 
destinatarios. Queda prohibida su divulgaci�n, copia o distribuci�n a terceros sin la 
previa autorizaci�n escrita de Indra. En el caso de haber recibido este correo 
electr�nico por error, se ruega notificar inmediatamente esta circunstancia mediante 
reenv�o a la direcci�n electr�nica del remitente.

The information in this e-mail and in any attachments is confidential and solely for 
the attention and use of the named addressee(s). You are hereby notified that any 
dissemination, distribution or copy of this communication is prohibited without the 
prior written consent of Indra. If you have received this communication in error, 
please, notify the sender by reply e-mail

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



Reply via email to