logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From codeMonkey <harriet.lo...@gmail.com>
Subject Re: Rolling File Appender with a fixed extention
Date Mon, 05 May 2014 06:39:07 GMT
I would like my log files to have the following behaviour: 

MyApp_2014-06-24.log          (this would be the current log file) 
MyApp_1_2014-06-24.log       etc. 

I would like to keep the last 10 files, of the last 2 days, and the files
should be of maximum 15MB size. 

Any help would be appreciated:) 

Here is what I have so far: 
    <appender name="RollingLogFileAppender"
      <file value="${APPDATA}\logs\MyApp"/>
      <appendToFile value="true"/>
      <rollingStyle value="Composite"/>
      <datePattern value=".yyyy-MM-dd'.log'"/>
      <maxSizeRollBackups value="10"/>
      <maximumFileSize value="15MB"/>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger
[%property{NDC}] - %message%newline"/>

View this message in context: http://apache-logging.6191.n7.nabble.com/Rolling-File-Appender-with-a-fixed-extention-tp46662p46766.html
Sent from the Log4net - Users mailing list archive at Nabble.com.

View raw message