Hello all, My Logger uses a RollingFileAppender with a TimeBasedTriggeringPolicy.
The file pattern is set to: logfile.log.%d{yyyy-MM-dd} I would like to write automated functional tests that use the logger and verify that the rolling of the file is performed according to the expected behavior of the TimeBasedTriggeringPolicy. In other words, I'd like to write a system test that does something like the following: 1) start the system (assuming that the current date is 2016-02-4) 2) log a message. This message will be written to logfile.log. 3) Verify that the message was logged to logfile.log. 4) Force the log file to rotate. 5) Verify that the file logfile.log.2016-02-05 was created with the correct contents. 6) log a message. This message will be written to logfile.log. 7) Verify that the message was logged to logfile.log. Is there any way that I could perform step #4? One way that I was thinking of is if I could use my own implementation of the LogEvent that would return a fake event time for each event. What are your thoughts? Thank you very much.