I'd like current messages to always be logged into a file with the same
name (e.g., mylogs.log). When a file hits a maximum size I'd like
to have the file
renamed and have future logs go into a new file with the same name as
before (i.e., mylogs.log). The old file would be renamed to a name that
includes a
sequence number and date (e.g., mylogs20051109.2.log for today's second
log file). It would be OK if the date didn't get added to the name
until the next day.
The RollingFileAppender does this fine except that the sequence number becomes the file extension.
Is there a way to configure the RollingFileAppender to do this?
I'm currently using the following configuration:
<appender name="Dev4RollingFile" type="log4net.Appender.RollingFileAppender">
<file value="C:\\ProphIT_CTI" />
<maximumFileSize value="500KB" />
<maxSizeRollBackups value="5" />
<datePattern value="yyyy-MM-dd'.log'" />
<staticLogFileName value="false" />
<rollingStyle value="Composite" />
<appendToFile value="true" />
<countDirection value="0" />
<layout type="log4net.Layout.XmlLayoutSchemaLog4j" />
</appender>
Thanks.
--
Mike Blake-Knox
- RollingFileAppender: log files with constant extension and... Mike Blake-Knox
