kknight2046
Programmer
I have a question about how to configure the log4j properties, so each time the application starts, the log file will be cleaned up first, instead of logs being appended to the existing log file content.
My configures is like below:
log4j.appender.appResults_Appender=org.apache.log4j.FileAppender
log4j.appender.appResults_Appender.File=appResults.log
log4j.appender.appResults_Appender.Append=false
log4j.appender.appResults_Appender.Threshold=DEBUG
log4j.appender.appResults_Appender.layout=org.apache.log4j.PatternLayout
log4j.appender.appResults_Appender.layout.ConversionPattern= %m%n
When I set log4j.appender.appResults_Appender.Append=false, the log file is cleaned up when my program starts, but the program could not add logs to the log file any more.
Thanks.
My configures is like below:
log4j.appender.appResults_Appender=org.apache.log4j.FileAppender
log4j.appender.appResults_Appender.File=appResults.log
log4j.appender.appResults_Appender.Append=false
log4j.appender.appResults_Appender.Threshold=DEBUG
log4j.appender.appResults_Appender.layout=org.apache.log4j.PatternLayout
log4j.appender.appResults_Appender.layout.ConversionPattern= %m%n
When I set log4j.appender.appResults_Appender.Append=false, the log file is cleaned up when my program starts, but the program could not add logs to the log file any more.
Thanks.