I am new to this log4j and managed to install on eclipse and run it. I understand the priority chain at the levels, and now this is my configuration of the properties file:
log4j.rootLogger = DEBUG, rollingFile, console log4j.appender.rollingFile=org.apache.log4j.RollingFileAppender log4j.appender.rollingFile.Threshold=INFO log4j.appender.rollingFile.File=logs/logFile.log log4j.appender.rollingFile.MaxFileSize=1MB log4j.appender.rollingFile.MaxBackupIndex=5 log4j.appender.rollingFile.layout = org.apache.log4j.PatternLayout log4j.appender.rollingFile.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c: %m%n log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.Threshold=DEBUG log4j.appender.console.Target=System.out log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p - %m%n
I have 2 questions for this log4j
1) Is it possible for log4j to clear my log file every time the application starts? I am not sure how to do this.
2) Well, from the configuration, I configure my console to print debugging, but what I really wanted it to print was a pure debug msg, not an INFO message. Is there any way to control this? As soon as debugging and printing errors, if the threshold is set for debugging?
source share