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 "Tal G (JIRA)" <ji...@apache.org> on 2006/07/25 10:33:14 UTC

[jira] Created: (LOG4NET-86) In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue

In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue
-----------------------------------------------------------------------------------------

                 Key: LOG4NET-86
                 URL: http://issues.apache.org/jira/browse/LOG4NET-86
             Project: Log4net
          Issue Type: Bug
          Components: Appenders
    Affects Versions: 1.2.10
         Environment: All
            Reporter: Tal G


In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue the log4net
1. Open a new file with .-2147483648 extension. And stop deleting old files for example file with extension .2147483638.
2. When i restart my application, it start writing log on the file with .-2147483648 although the newest file is with extension .-2147483643.
3. etc.. many more bugs related to this issue

I suggest that when the file extension reach int.MaxValue move to 0 again and continue properly deleting old files and openning new files.

-- 
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-86) In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue

Posted by "Tal G (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-86?page=comments#action_12423532 ] 
            
Tal G commented on LOG4NET-86:
------------------------------

I do have only 11 files simultaneously because MaxSizeRollBackups = 10.
So I have file .2147483638 up to file .-2147483648 - only 11 files and when .2147483638 is full than the problem occur.

> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue
> -----------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-86
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-86
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: All
>            Reporter: Tal G
>
> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue the log4net
> 1. Open a new file with .-2147483648 extension. And stop deleting old files for example file with extension .2147483638.
> 2. When i restart my application, it start writing log on the file with .-2147483648 although the newest file is with extension .-2147483643.
> 3. etc.. many more bugs related to this issue
> I suggest that when the file extension reach int.MaxValue move to 0 again and continue properly deleting old files and opening new files.

-- 
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-86) In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue

Posted by "Nicko Cadell (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-86?page=comments#action_12424306 ] 
            
Nicko Cadell commented on LOG4NET-86:
-------------------------------------

Ron,

If CountDirection is > 0 then the latest file will be the highest numbered one, when a log file is rolled, none of the files are renamed. This works well for large numbers of rolled files.

Tal,

In your case with only 11 files do you need to use CountDirection=1? The overhead of renaming the rolled files should not be significant.

> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue
> -----------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-86
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-86
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: All
>            Reporter: Tal G
>
> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue the log4net
> 1. Open a new file with .-2147483648 extension. And stop deleting old files for example file with extension .2147483638.
> 2. When i restart my application, it start writing log on the file with .-2147483648 although the newest file is with extension .-2147483643.
> 3. etc.. many more bugs related to this issue
> I suggest that when the file extension reach int.MaxValue move to 0 again and continue properly deleting old files and opening new files.

-- 
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] Resolved: (LOG4NET-86) In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4NET-86?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ron Grabowski resolved LOG4NET-86.
----------------------------------

    Resolution: Won't Fix

The behavior when there are millions and millions of files in a folder that need rolled is undefined.

I'll gladly accept a patch to improve this part of the the code or new code extracts the logic for how things are rolled so it can be more easily extended.

> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue
> -----------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-86
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-86
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: All
>            Reporter: Tal G
>
> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue the log4net
> 1. Open a new file with .-2147483648 extension. And stop deleting old files for example file with extension .2147483638.
> 2. When i restart my application, it start writing log on the file with .-2147483648 although the newest file is with extension .-2147483643.
> 3. etc.. many more bugs related to this issue
> I suggest that when the file extension reach int.MaxValue move to 0 again and continue properly deleting old files and opening new files.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LOG4NET-86) In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue

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

Tal G updated LOG4NET-86:
-------------------------

    Description: 
In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue the log4net
1. Open a new file with .-2147483648 extension. And stop deleting old files for example file with extension .2147483638.
2. When i restart my application, it start writing log on the file with .-2147483648 although the newest file is with extension .-2147483643.
3. etc.. many more bugs related to this issue

I suggest that when the file extension reach int.MaxValue move to 0 again and continue properly deleting old files and opening new files.

  was:
In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue the log4net
1. Open a new file with .-2147483648 extension. And stop deleting old files for example file with extension .2147483638.
2. When i restart my application, it start writing log on the file with .-2147483648 although the newest file is with extension .-2147483643.
3. etc.. many more bugs related to this issue

I suggest that when the file extension reach int.MaxValue move to 0 again and continue properly deleting old files and openning new files.


> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue
> -----------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-86
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-86
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: All
>            Reporter: Tal G
>
> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue the log4net
> 1. Open a new file with .-2147483648 extension. And stop deleting old files for example file with extension .2147483638.
> 2. When i restart my application, it start writing log on the file with .-2147483648 although the newest file is with extension .-2147483643.
> 3. etc.. many more bugs related to this issue
> I suggest that when the file extension reach int.MaxValue move to 0 again and continue properly deleting old files and opening new files.

-- 
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-86) In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-86?page=comments#action_12423989 ] 
            
Ron Grabowski commented on LOG4NET-86:
--------------------------------------

Forgive the naive question...but if you have 11 files shouldn't the files be named:

 log.txt.0
 log.txt.1
 log.txt.2
 ...
 log.txt.9
 log.txt.10

How are you starting at ~2million for your file extensions?

> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue
> -----------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-86
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-86
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: All
>            Reporter: Tal G
>
> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue the log4net
> 1. Open a new file with .-2147483648 extension. And stop deleting old files for example file with extension .2147483638.
> 2. When i restart my application, it start writing log on the file with .-2147483648 although the newest file is with extension .-2147483643.
> 3. etc.. many more bugs related to this issue
> I suggest that when the file extension reach int.MaxValue move to 0 again and continue properly deleting old files and opening new files.

-- 
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-86) In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue

Posted by "Nicko Cadell (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-86?page=comments#action_12424324 ] 
            
Nicko Cadell commented on LOG4NET-86:
-------------------------------------

The only problem with rolling the counter back to 0 is if the appender is initialised with the existing files straddling the int max value: for example if the following files exist:

Log.2147483645
Log.2147483646
Log.2147483647
Log.0
Log.1
Log.2

In this case the latest file is Log.2. Then when the RollingFileAppender is initialised it looks for the highest numbered file, i.e. 2147483647, it would then roll back to 0 and overwrite the files 0, 1, and 2.

I'm assuming this would be a bad thing.

Currently the m_curSizeRollBackups is stored and processed as an int, giving a max value of 2147483647. We could change this to a decimal giving a max value of 79228162514264337593543950335. This would postpone the problem rather than fix it, but it would postpone it for a rather long time. If we use decimals then you can roll a new file every millisecond for 2512308552583217199 years before the overflow condition is reached.

> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue
> -----------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-86
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-86
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: All
>            Reporter: Tal G
>
> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue the log4net
> 1. Open a new file with .-2147483648 extension. And stop deleting old files for example file with extension .2147483638.
> 2. When i restart my application, it start writing log on the file with .-2147483648 although the newest file is with extension .-2147483643.
> 3. etc.. many more bugs related to this issue
> I suggest that when the file extension reach int.MaxValue move to 0 again and continue properly deleting old files and opening new files.

-- 
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-86) In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue

Posted by "Nicko Cadell (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-86?page=comments#action_12424446 ] 
            
Nicko Cadell commented on LOG4NET-86:
-------------------------------------

I agree that adding code to correctly handle the wrap around condition would be better than just expanding the number space by switching to a decimal type.

Would you be able to contribute a patch to support rolling the curSizeRollBackups back round to 0?

> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue
> -----------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-86
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-86
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: All
>            Reporter: Tal G
>
> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue the log4net
> 1. Open a new file with .-2147483648 extension. And stop deleting old files for example file with extension .2147483638.
> 2. When i restart my application, it start writing log on the file with .-2147483648 although the newest file is with extension .-2147483643.
> 3. etc.. many more bugs related to this issue
> I suggest that when the file extension reach int.MaxValue move to 0 again and continue properly deleting old files and opening new files.

-- 
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-86) In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue

Posted by "Tal G (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-86?page=comments#action_12423533 ] 
            
Tal G commented on LOG4NET-86:
------------------------------

I meant when .-2147483648 is full the problem occur.

> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue
> -----------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-86
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-86
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: All
>            Reporter: Tal G
>
> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue the log4net
> 1. Open a new file with .-2147483648 extension. And stop deleting old files for example file with extension .2147483638.
> 2. When i restart my application, it start writing log on the file with .-2147483648 although the newest file is with extension .-2147483643.
> 3. etc.. many more bugs related to this issue
> I suggest that when the file extension reach int.MaxValue move to 0 again and continue properly deleting old files and opening new files.

-- 
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-86) In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-86?page=comments#action_12423481 ] 
            
Ron Grabowski commented on LOG4NET-86:
--------------------------------------

You have a folder with 2,147,483,638 files in it? That's a lot of files. NTFS supports 4,294,967,295 files in a folder. Do we need to support and/or manage that many files...probably not. If you need to put that many files in a folder perhaps you should think about extending the RollingFileAppender.

> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue
> -----------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-86
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-86
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: All
>            Reporter: Tal G
>
> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue the log4net
> 1. Open a new file with .-2147483648 extension. And stop deleting old files for example file with extension .2147483638.
> 2. When i restart my application, it start writing log on the file with .-2147483648 although the newest file is with extension .-2147483643.
> 3. etc.. many more bugs related to this issue
> I suggest that when the file extension reach int.MaxValue move to 0 again and continue properly deleting old files and opening new files.

-- 
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-86) In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue

Posted by "Tal G (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-86?page=comments#action_12424357 ] 
            
Tal G commented on LOG4NET-86:
------------------------------

Nicko - I have two problems when using CountDirection=0.
1. For example if file.2 is locked, then when rolling, the information in file.1 will be lose.
2. I am having some cases when it takes too much time to roll, and I am having a soft real time environment.

About the decimal -
1. You are right that decimal max value is enough, but we are having some relations with other companies that give certification to our applications, and they try to check all the extreme cases such as this.
2. We can overcome on the problem of moving to 0, we can add some code than deal with this.


> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue
> -----------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-86
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-86
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: All
>            Reporter: Tal G
>
> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue the log4net
> 1. Open a new file with .-2147483648 extension. And stop deleting old files for example file with extension .2147483638.
> 2. When i restart my application, it start writing log on the file with .-2147483648 although the newest file is with extension .-2147483643.
> 3. etc.. many more bugs related to this issue
> I suggest that when the file extension reach int.MaxValue move to 0 again and continue properly deleting old files and opening new files.

-- 
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-86) In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue

Posted by "Ron Grabowski (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-86?page=comments#action_12441867 ] 
            
Ron Grabowski commented on LOG4NET-86:
--------------------------------------

Does this issue describe a problem for real applications? It sounds like a very hypothetical edge case. On that note, can we continue to add extensions to the file name:

Log.2147483647.1
Log.2147483647.2
Log.2147483647.3
...
Log.2147483647.2147483647
Log.2147483647.2147483647.1
Log.2147483647.2147483647.2
Log.2147483647.2147483647.3
...
Log.2147483647.2147483647.2147483647
Log.2147483647.2147483647.2147483647.2147483647
...

There's an example with a directory containing ~8.5 million files :-/

> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue
> -----------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-86
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-86
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: All
>            Reporter: Tal G
>
> In RollingFileAppender when setting CountDirection=1 and the curr size reach int.MaxValue the log4net
> 1. Open a new file with .-2147483648 extension. And stop deleting old files for example file with extension .2147483638.
> 2. When i restart my application, it start writing log on the file with .-2147483648 although the newest file is with extension .-2147483643.
> 3. etc.. many more bugs related to this issue
> I suggest that when the file extension reach int.MaxValue move to 0 again and continue properly deleting old files and opening new files.

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