logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edwin Rios (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4NET-468) Problem when use "PreserveLogFileNameExtension=true" and "CountDirection=0"
Date Wed, 15 Jul 2015 00:11:05 GMT

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

Edwin Rios commented on LOG4NET-468:
------------------------------------

Hello,

Thanks for answer.

What I can see is when "CountDirection" property is "0", and "PreserveLogFileNameExtension"
is "false", the file name continue incrementing normally, like versions 1.2.10 and like the
documentation says.

But when "CountDirection" property is "0", and "PreserveLogFileNameExtension" is "true", it
fails.


https://logging.apache.org/log4net/release/sdk/index.html

log4net.Appender.RollingFileAppender.CountDirection

Remarks
CountDirection >= 0 does the opposite i.e. log.1 is the first backup made, log.5 is the
5th backup made, etc. For infinite backups use CountDirection >= 0 to reduce rollover costs.

Thanks


> Problem when use "PreserveLogFileNameExtension=true" and "CountDirection=0"
> ---------------------------------------------------------------------------
>
>                 Key: LOG4NET-468
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-468
>             Project: Log4net
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.13
>         Environment: Windows Server 2003
>            Reporter: Edwin Rios
>            Priority: Minor
>
> 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>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message