[ 
https://issues.apache.org/jira/browse/LOG4NET-64?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13249380#comment-13249380
 ] 

Petr Vones commented on LOG4NET-64:
-----------------------------------

I does not work for Date or Composite RollingStyle in 1.2.11.0 release version. 
It still apeends the datePattern at the end of filename. The only configuration 
when it works is Size RollingStyle. The configuration is:

  <log4net>
    <appender name="File" type="log4net.Appender.RollingFileAppender">
      <file value="Application.log"/>
      <appendToFile value="true"/>
      <rollingStyle value="Composite"/>
      <maxSizeRollBackups value="-1"/>
      <maximumFileSize value="100KB"/>
      <datePattern value="yyyyMMdd"/>
      <preserveLogFileNameExtension value="true"/>
      <filter type="log4net.Filter.LevelRangeFilter">
        <acceptOnMatch value="true"/>
        <levelMin value="DEBUG"/>
        <levelMax value="FATAL"/>
      </filter>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date %-5level [%property] %logger - 
%message%newline"/>
      </layout>
    </appender>
    <root>
      <level value="ALL"/>
      <appender-ref ref="File"/>
    </root>
  </log4net>


And the output is:
Application.1.log
Application.1.log20120406
Application.log
Application.log20120406

                
> [PATCH] to RollingFileAppender.cs to add the ability to preserve the log file 
> name extension when rolling the log file.
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-64
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-64
>             Project: Log4net
>          Issue Type: New Feature
>          Components: Appenders
>    Affects Versions: 1.2.9
>            Reporter: Joshua Bassett
>            Assignee: Ron Grabowski
>             Fix For: 1.2.11
>
>         Attachments: LOG4NET-64.patch, LOG4NET-64.patch, log4net-64.patch, 
> patch.txt
>
>
> Normally, when the log file is rolled the file name extension is not 
> preserved.
> For example, file.log is rolled to file.log.1 or file.log.yyyy-MM-dd.
> However, this may not be desired in all cases and it may be necessary to 
> preserve the log file name extension when the log file is rolled. Most 
> notably, this feature is useful for maintaining file associations under 
> Windows so that all log files can be associated with a particaular text 
> viewer.
> For example, file.log is rolled to file.1.log or file.yyyy-MM-dd.log.
> This patch adds an additional boolean property PreserveLogFileNameExtension 
> to the RollingFileAppender class which is used to toggle this behavior.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to