Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-468

Problem when use "PreserveLogFileNameExtension=true" and "CountDirection=0"

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.2.13
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Windows Server 2003

      Description

      I was using the Log4Net 1.2.10 (Framework 2.0) and I needed to use "CountDirection" property but also I needed to have the same file extension, but in this version the backup file name is like "xxxx.log.1". So, I searched and found that the version 1.2.13 have the "PreserveLogFileNameExtension" property, so I decided to test it.

      But I found that when I use the "PreserveLogFileNameExtension = true" and the "CountDirection = 0", the "CountDirection" does not increment the name of the backup file, only until ONE.

      The xml in web.config looks like this:
      <log4net>
      <!-Log AplicaciĆ³n->
      <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender,log4net">
      <param name="File" value="./logs/777_Trace" />
      <param name="AppendToFile" value="true" />
      <param name="RollingStyle" value="Composite" />
      <param name="DatePattern" value="_yyyy-MM-dd'.log'" />
      <param name="StaticLogFileName" value="false" />
      <param name="CountDirection" value="0" />
      <param name="PreserveLogFileNameExtension" value="true" />
      <maximumFileSize value="1KB"/>
      <maxSizeRollBackups value="20"/>
      <layout type="log4net.Layout.PatternLayout,log4net">
      <param name="ConversionPattern" value="%date [%thread] %-5level %logger - %message%newline" />
      </layout>
      </appender>
      <root>
      <level value="DEBUG" />
      </root>
      <!-- log only messages of level DEBUG or above in the package specified below -->
      <logger name="logAplicacion">
      <level value="DEBUG"/>
      <appender-ref ref="RollingLogFileAppender"/>
      </logger>

      <logger name="getWebRequest">
      <level value="DEBUG"/>
      </logger>

      <logger name="getWebService">
      <level value="DEBUG"/>
      </logger>

      <logger name="dbRequest">
      <level value="DEBUG" />
      </logger>

      <logger name="dbInputForm">
      <level value="DEBUG" />
      </logger>

      <logger name="recordCapture">
      <level value="DEBUG" />
      </logger>
      </log4net>

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              edwinfrios Edwin Rios
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: