I have below settings for log4j.properties. But all log text whether info,debug,exception,fatal goes to MyDebugFile
. No file prefixed with exception is created.
My question are:
- Can I mention same file for log4j.appender.EXCEPTION_LOG_FILE and log4j.appender.DEBUG_LOG_FILE
- What does property log4j.appender.EXCEPTION_LOG_FILE.Threshold specify?
- Why is the file prefixed with exception is not created?
Set up the format for messages logged to the Exception log file.
log4j.appender.EXCEPTION_LOG_FILE=biz.minaret.log4j.DatedFileAppender
log4j.appender.EXCEPTION_LOG_FILE.Threshold=INFO
log4j.appender.EXCEPTION_LOG_FILE.Directory=C:/log/
log4j.appender.EXCEPTION_LOG_FILE.Prefix=exception.
log4j.appender.EXCEPTION_LOG_FILE.Suffix=.log
log4j.appender.EXCEPTION_LOG_FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.EXCEPTION_LOG_FILE.layout.ConversionPattern=%d [%t] %-5p %c{3} - %m%n
log4j.appender.EXCEPTION_LOG_FILE.MaxFileSize=100KB
log4j.appender.EXCEPTION_LOG_FILE.MaxBackupIndex=4
Set up the format for messages logged to the debug log file.
log4j.appender.DEBUG_LOG_FILE=biz.minaret.log4j.DatedFileAppender
log4j.appender.DEBUG_LOG_FILE.Directory=C:/log/
log4j.appender.DEBUG_LOG_FILE.Prefix=MyDebugFile.
log4j.appender.DEBUG_LOG_FILE.Suffix=.log
log4j.appender.DEBUG_LOG_FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.DEBUG_LOG_FILE.layout.ConversionPattern=%d [%t] %-5p %c{3} - %m%n
log4j.appender.DEBUG_LOG_FILE.MaxFileSize=100KB
log4j.appender.DEBUG_LOG_FILE.MaxBackupIndex=4