Details
-
New Feature
-
Resolution: Unresolved
-
Critical
-
None
-
None
-
None
Description
I would like to make logback create TimeBasedRollingPolicy file names that use leading 0s for %i. Here's an excerpt from the logback.xml file
<rollingPolicy class="ch.quos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>logs/foo_%d
-%i.log</fileNamePattern>
...
</rollingPolicy>
The created filenames will be foo_20130501-0.log, foo_20130501-1.log, ... foo_20130501-9.log, foo_20130501-10.log, ...
Instead, I would like the files named like this: foo_20130501-000.log, foo_20130501-001.log, ... foo_20130501-009.log, foo_20130501-010.log, ...
I'm using 3 digits width as an example (my use cases are actually 2 and 4 digits). The implemented feature should be able to handle any positively number width, and deal with overflows.