[
https://issues.apache.org/jira/browse/LOG4NET-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439490#comment-13439490
]
Jaap Taal commented on LOG4NET-82:
----------------------------------
Since it is an old issue but Open and Unresolved, I'm still having this 1.2.11.
The log files mentioned are absent.
I have this without tweaking with the date time. However I believe the
following happens:
{noformat}
<staticLogFileName>true</staticLogFileName>
<rollingStyle value="Composite"/>
<datePattern value="yyyy-MM-dd"/>
{noformat}
When rolling from todays .txt to a .2 file, an existing .2 needs to be rolled
to a day later, but this doesn't happen somehow and the file is deleted.
On the console I see:
{noformat}
log4net:WARN Cannot RollFile [C:\inetpub\wwwroot\logs\log-harvester.txt.2] ->
[C:\inetpub\wwwroot\logs\log-harvester.txt2012-08-21.2]. Source does not exist
log4net:WARN Cannot RollFile [C:\inetpub\wwwroot\logs\log-harvester.txt.3] ->
[C:\inetpub\wwwroot\logs\log-harvester.txt2012-08-21.3]. Source does not exist
{noformat}
the files log-harvester.txt2012-08-21.2 and .3 don't exist and
log-harvester.txt.2 has logfiles from today.
I'm going to watch if the log file rotates again today and see if that destroys
more log files. \log-harvester.txt2012-08-21.4 is currently present and so is
\log-harvester.txt2012-08-21.5
> RollingFileAppender: Cannot RollFile ... Source does not exist
> ---------------------------------------------------------------
>
> Key: LOG4NET-82
> URL: https://issues.apache.org/jira/browse/LOG4NET-82
> Project: Log4net
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 1.2.9, 1.2.10
> Environment: Windows 2003 Server
> Reporter: Kenneth Oberleitner
> Fix For: 1.2 Maintenance Release
>
>
> The following logging configuration will produce an endless loop of warnings
> under the following circumstances:
> <appender name="AppRollingFileAppender"
> type="log4net.Appender.RollingFileAppender">
> <param name="Threshold" value="ALL"/>
> <param name="File" value="Log\\Audit\\audit.txt" />
> <param name="AppendToFile" value="true" />
> <param name="MaxSizeRollBackups" value="-1" />
> <param name="RollingStyle" value="Date" />
> <param name="StaticLogFileName" value="true" />
> <param name="CountDirection" value="1" />
> <param name="DatePattern" value=".yyyyMMdd" />
> <layout type="log4net.Layout.PatternLayout">
> <param name="ConversionPattern" value="%date
> [%c(%property{log4net:HostName})-<%ndc>] - %message%newline" />
> </layout>
> </appender>
> 1.) set your system clock back at least three days
> 2.) run an application to create the static log file dated 3 days prior
> 3.) set your system clock forward a day (i.e. from Monday to Tuesday)
> 4.) run the application again, the log file will roll and a new static
> log file is written
> 5.) set your system clock forward a day (i.e. from Monday to Tuesday)
> 6.) run the application
> repeated warnings will be issued until the application is killed
> log4net:WARN RollingFileAppender: Cannot RollFile
> [E:\tmp\LoggingFileLockBug\LoggingFileLockBug\bin\Debug\Log\Audit\audit.txt.XXX]
> ->
> [E:\tmp\LoggingFileLockBug\LoggingFileLockBug\bin\Debug\Log\Audit\audit.txt.20060719.XXX].
> Source does not exist
> where XXX is infinitely incremented until the process is halted
> Two workarounds found so far both involve changing the date pattern. Both
> "yyyyMMdd" and ".yyyy-MM-dd" seem to work without issue.
--
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