[logback-user] FixedWindowRollingPolicy with date rename on roll-over

Deepak Abraham deepakab03-sw at yahoo.com
Tue Aug 20 12:28:27 CEST 2019


I am able to use the FixedWindowRollingPolicy along with SizeBasedTriggeringPolicy to achieve roll over based on defined file size (logback-1.2.3) . However I need to change the name of the file on roll-over such that instead of the index the current date and time would be used in the rolled over file name.

For example: if the current file name is abcApp.log, the rolled over file name should be abcApp_2019-08-20_203522.log
(The roll0over would happen when the defined file size is reached based on the defined SizeBasedTriggeringPolicy)

Is there any way in existing rolling Policy classes that support this? I couldn't find any. Or any other way to achieve this?

If there is no support for this, I would be willing to add support by either tweaking the existing FixedWindowRollingPolicy class or creating a similar new class and supplying the same. Please let me know.

Thanks & Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20190820/b7063a67/attachment.html>

More information about the logback-user mailing list