I have a C# application that uses log4net for logging facilities. Using the RollingFileAppender and a mostly-default configuration, I get a list of files that either is or isn't convenient, depending on whether or not the program I'm using to view does smart ordering:
trace.log.xml
trace.log.xml.1
trace.log.xml.10
...
trace.log.xml.19
trace.log.xml.2
trace.log.xml.20
...
trace.log.xml.2015-11-16.19
trace.log.xml.2015-11-16.2
trace.log.xml.2015-11-16.20
trace.log.xml.2015-11-16.3
...
trace.log.xml.2015-11-16.9
trace.log.xml.3
trace.log.xml.4
trace.log.xml.5
trace.log.xml.6
trace.log.xml.7
trace.log.xml.8
trace.log.xml.9
I'd like to remedy this with some zero-padding. Instead of e.g. trace.log.xml.5
or trace.log.xml.17
, I'd rather have the filename be trace.log.xml.0005
or trace.log.xml.0017
.
(I have a %04d
in hand and I don't know where it goes.)