Reputation: 58
With log4j, I want the behaviour of the DailyRollingFileAppender so that date-pattern based log rolling can occur when an application starts up. BUT once the application has started, I don't want it to do any automatic log rotation until the next time the application restarts. How can I configure log4j to do this?
Upvotes: 1
Views: 1890
Reputation: 272437
Your specification sounds like you want the application to start, create a log file of a particular date, and to keep using that until it shuts down.
If that's the case, you may want to create your own Appender implementation, perhaps deriving from FileAppender
Upvotes: 1
Reputation: 1516
You will have to programatically set the logger properties by iterating over all the loggers, getting your logger and then asking ti not to roll anymore. Thats the only way I think.
Upvotes: 1