logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brenda Bell (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LOG4NET-361) RollingLogFileAppender does not correctly initialize the backup index when style is date or composite
Date Mon, 05 Nov 2012 19:18:12 GMT
Brenda Bell created LOG4NET-361:
-----------------------------------

             Summary: RollingLogFileAppender does not correctly initialize the backup index
when style is date or composite
                 Key: LOG4NET-361
                 URL: https://issues.apache.org/jira/browse/LOG4NET-361
             Project: Log4net
          Issue Type: Bug
          Components: Appenders
    Affects Versions: 1.2.11
            Reporter: Brenda Bell


If there are no log files when a process starts, everything is fine. A new log is created
and the files are properly rolled to .1, .2, .3, etc. A new log is also created the next day
with correct indexes.

However, if log files exist for any day when the process starts, RollingLogFileAppender incorrectly
initializes the starting backup index to the maximum index for all days instead of using the
maximum index for the current day. In other words, it completely ignores the date pattern
when determining whether to consider a particular file in the backup index algorithm.

It looks like the error stems from the following code being commented out on lines 893-901:

			if (m_staticLogFileName) 
			{
				int endLength = curFileName.Length - index;
				if (baseFile.Length + endLength != curFileName.Length) 
				{
					// file is probably scheduledFilename + .x so I don't care
					return;
				}
			}

This code is not commented out in 1.2.10 and we do not see the issue after downgrading to
the earlier release.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message