You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Stefan Bodewig (Commented) (JIRA)" <ji...@apache.org> on 2011/10/28 10:38:32 UTC

[jira] [Commented] (LOG4NET-234) RollingFileAppender generates incorrect file name

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

Stefan Bodewig commented on LOG4NET-234:
----------------------------------------

Probably related: http://stackoverflow.com/questions/579688/why-is-the-date-appended-twice-on-filenames-when-using-log4net

                
> RollingFileAppender generates incorrect file name
> -------------------------------------------------
>
>                 Key: LOG4NET-234
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-234
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: Windows XP, Windows 2003
>            Reporter: Miroslav Vanicky
>             Fix For: 1.2 Maintenance Release
>
>         Attachments: logs.zip
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I have Appender defined as follow...
> <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender" >
>     <file value="Logs\Log" /> <!-- Základní název souboru -->
>     <appendtofile value="true" />
>     <rollingstyle value="Date" /> <!-- Soubory budou vznikat na základě datumu/času logu -->
>     <datepattern value="_yyyy-MM-dd.\tx\t"/> <!-- Maska pro název souboru (to .\tx\t tam musí být, aby byla přípona .txt)-->
>     <StaticLogFileName value="false" /> <!-- Už první vzniklý soubor bude mít název obsahující datum. Jinak by logoval stále do jednoho stejného souboru a ten by v případě potřeby (změna datumu) přejmenoval -->
>     <!-- Co a jak bude formátováno ve výstupu.
>     Seznam všech dostupných %proměnných je na: http://logging.apache.org/log4net/release/sdk/log4net.Layout.PatternLayout.html 
>     Na stejné stránce dole je popsáno i co znamená to -5level apod. -->
>     <layout type="log4net.Layout.PatternLayout">
>       <conversionpattern value="%date [%-5level] - %message%newline"></conversionpattern>
>     </layout>
>   </appender>
> This Appender should generate file names like "Log_2009-10-15.txt", mostly it works fine, but in some unknown situations it generates file named "Log_2009-10-15.txt_2009-10-15.txt". It seems to me that this happens when there were no log-files and the incorrectly named file was the first log-file generated.

--
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