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 "Kenneth Oberleitner (JIRA)" <ji...@apache.org> on 2006/07/21 22:37:14 UTC

[jira] Created: (LOG4NET-82) RollingFileAppender: Cannot RollFile ... Source does not exist

RollingFileAppender: Cannot RollFile ... Source does not  exist
---------------------------------------------------------------

                 Key: LOG4NET-82
                 URL: http://issues.apache.org/jira/browse/LOG4NET-82
             Project: Log4net
          Issue Type: Bug
          Components: Appenders
    Affects Versions: 1.2.9
         Environment: Windows 2003 Server
            Reporter: Kenneth Oberleitner


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})-&lt;%ndc&gt;] - %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 contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (LOG4NET-82) RollingFileAppender: Cannot RollFile ... Source does not exist

Posted by "Thorbjorn Kvam (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LOG4NET-82?page=all ]

Thorbjorn Kvam updated LOG4NET-82:
----------------------------------

    Affects Version/s: 1.2.10

We are running v1.10, which is also affected.  Also, the reported workaround with changing the datepatterns doesn't help in our case. Tried both the suggested datePattern changes without luck. 

> RollingFileAppender: Cannot RollFile ... Source does not  exist
> ---------------------------------------------------------------
>
>                 Key: LOG4NET-82
>                 URL: http://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
>
> 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})-&lt;%ndc&gt;] - %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 contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (LOG4NET-82) RollingFileAppender: Cannot RollFile ... Source does not exist

Posted by "Kenneth Oberleitner (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-82?page=comments#action_12423114 ] 
            
Kenneth Oberleitner commented on LOG4NET-82:
--------------------------------------------

I am experiencing the issue with 1.2.10 also. I have traced through the code and the loop causing the issue is in the function RollOverTime(bool fileIsOpen) of RollingFileAppender.cs.

for (int i = 1; i <= m_curSizeRollBackups; i++)  

The member variable m_curSizeRollBackups has the date pattern yyyyMMdd value of the last file rolled. This is being initialized in try/catch block of the function InitializeFromOneFile(string baseFile, string curFileName) 

if (SystemInfo.TryParse(curFileName.Substring(index + 1), out backup)) 

is setting the backup count to our last rolling file date, and from there the logic assumes we have that many backup files. This would explain why changing the pattern resolves the issue, I would assume DatePatterns with non-numeric characters cause TryParse to fail.


> RollingFileAppender: Cannot RollFile ... Source does not  exist
> ---------------------------------------------------------------
>
>                 Key: LOG4NET-82
>                 URL: http://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
>
> 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})-&lt;%ndc&gt;] - %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 contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (LOG4NET-82) RollingFileAppender: Cannot RollFile ... Source does not exist

Posted by "Kenneth Oberleitner (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-82?page=comments#action_12423933 ] 
            
Kenneth Oberleitner commented on LOG4NET-82:
--------------------------------------------

In response to 

"We are running v1.10, which is also affected. Also, the reported workaround with changing the datepatterns doesn't help in our case. Tried both the suggested datePattern changes without luck. "

The DatePattern I suggested as a work around will only resolve the issue if there are no existing log files in the directory with the .yyyyMMdd extension.  You must begin using a different date pattern with an empty log file directory for it to work.

> RollingFileAppender: Cannot RollFile ... Source does not  exist
> ---------------------------------------------------------------
>
>                 Key: LOG4NET-82
>                 URL: http://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
>
> 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})-&lt;%ndc&gt;] - %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 contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (LOG4NET-82) RollingFileAppender: Cannot RollFile ... Source does not exist

Posted by "Thorbjorn Kvam (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-82?page=comments#action_12422992 ] 
            
Thorbjorn Kvam commented on LOG4NET-82:
---------------------------------------

We've experienced the same issue. We also use the .yyyyMMdd-pattern, and the described bug seem to occur if there are no logfiles from yesterday, but only older logfiles from three days or more back. That is, for instance on my developer computer, if I come back to work on a monday (when my computer have been doing nothing on saturday and sunday), this bug happened. 





> RollingFileAppender: Cannot RollFile ... Source does not  exist
> ---------------------------------------------------------------
>
>                 Key: LOG4NET-82
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-82
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.9
>         Environment: Windows 2003 Server
>            Reporter: Kenneth Oberleitner
>
> 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})-&lt;%ndc&gt;] - %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 contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira