logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From A. Caraiman <acarai...@gmail.com>
Subject Re: Logging to separate files with different levels
Date Fri, 03 Mar 2006 09:09:05 GMT
> 
Hi all,

on the exposed issue, i would like to ask you a small variation. Becouse I
actually need the logging from appender B also in the main logging file, I don't
'false' the additivity property. Instead I wold like to have only the
ERROR-level logging from the MyClass listed in the MyApp.log (something like
redirecting appender B to A).
Is this possible with log4j ?

Thanks
Adrian Caraiman



> My log4j.properties looks something like this:
> 
> log4j.rootLogger=ERROR, A
> log4j.appender.A=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.A.File=MyApp.log
> log4j.appender.A.DatePattern='.'yyyy-MM-dd
> log4j.appender.A.Append=true
> log4j.appender.A.layout=org.apache.log4j.PatternLayout
> log4j.appender.A.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %m%n
> 
> log4j.logger.com.mycomp.myapp.util.MyClass=DEBUG, B
> log4j.appender.B=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.B.File=MyClass.log
> log4j.appender.B.DatePattern='.'yyyy-MM-dd
> log4j.appender.B.Append=true
> log4j.appender.B.layout=org.apache.log4j.PatternLayout
> log4j.appender.B.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %m%n
> 






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


Mime
View raw message