I have the following configuration for log4j that outputs a csv log file. Every time my program runs, I want to run this log file, overwriting it without adding a log file. I thought I could achieve this using append=false. I know that I configured log4j correctly, as other logs output perfectly, but these are daily sliding logs that are added, which affects the desire.
Can someone tell me why append=falseit doesn't seem to work. Is there another setting that I missed?
Here is my configuration code:
log4j.logger.fetch.FetchDirectHolidays=debug, S
log4j.appender.S=org.apache.log4j.FileAppender
log4j.appender.S.File=xml\\logs\\FetchDirectHolidays.csv
log4j.appender.S.append=false
log4j.appender.S.layout=org.apache.log4j.PatternLayout
log4j.appender.S.layout.ConversionPattern= %p , %m%n
What is wrong with my configuration?
I forgot to indicate that my application is scheduled, and I just read that Append = false only clears the log file if the entire application is shut down and restarted. This does not help, since I need to clear this log file every time internal processes are executed.
source
share