Posted comments (3)

Posted by Tys at September 2, 2008 21:55:45 UTC
How do you configure log4j.properties to tell it to use 2 different loggers for log messages coming from 2 different class files.Following is the configuration I have :

log4j.rootLogger= DEBUG,stdout,BACServer,Mina

log4j.logger.src.main.java.reflexis.common.LogUtils = DEBUG,BACServer
log4j.appender.BACServer=org.apache.log4j.RollingFileAppender
log4j.appender.BACServer.File=C:/workspace_rws/BACServer/BACServer.log
log4j.appender.BACServer.append=true
log4j.appender.BACServer.MaxFileSize=10MB
log4j.appender.BACServer.MaxBackupIndex=1

log4j.appender.BACServer.layout=org.apache.log4j.PatternLayout
#log4j.appender.BACServer.layout.ConversionPattern=%d [%t] %p - %m%n
# p=priority t=thread m=msg n=new line

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.logger.src.main.java.reflexis.utils.LoggingAdapter = DEBUG,Mina
log4j.appender.Mina=org.apache.log4j.RollingFileAppender
log4j.appender.Mina.File=C:/workspace_rws/BACServer/Mina.log
log4j.appender.Mina.append=true
log4j.appender.Mina.MaxFileSize=10MB
log4j.appender.Mina.MaxBackupIndex=2
log4j.appender.Mina.layout=org.apache.log4j.PatternLayout


But It does not seem to work. Logs are going to both the files from both the classes.
Posted by Td at October 8, 2009 11:44:25 UTC
I want to know , can we have separate log files for info , debug ,warn etc ? I mean I want to have files such as warn.log where only warn statements get logged OR info.log where only info statements get logged. Please tel me the necessary configuration to achieve the same.

Thanks in advance.
Posted by Eswar at May 14, 2012 12:08:12 UTC
Hi,

What is the maximum value can given to MaxBackupIndex