You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2023/08/01 10:55:18 UTC

[I] Inverted rollover strategy in `log4j-1.2-api` (logging-log4j2)

ppkarwasz opened a new issue, #1650:
URL: https://github.com/apache/logging-log4j2/issues/1650

   ## Description
   
   The default rollover strategy in Log4j 1.x archived the current log file `File` **always** to `File.1`:
   
   > If `MaxBackupIndex` is positive, then files `{File.1, ..., File.MaxBackupIndex -1}` are renamed to `{File.2, ..., File.MaxBackupIndex}`. Moreover, `File` is renamed `File.1` and closed. A new `File` is created to receive further log output. [source [Javadoc](https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html#rollOver())]
   
   This corresponds to the `fileIndex="min"` rollover strategy of the version 2.x `RollingFileAppender` (cf. [documentation](https://logging.apache.org/log4j/2.x/manual/appenders.html#default-rollover-strategy)).
   
   However the [`RollingFileAppenderBuilder`](https://github.com/apache/logging-log4j2/blob/2.x/log4j-1.2-api/src/main/java/org/apache/log4j/builders/appender/RollingFileAppenderBuilder.java) from `log4j-1.2-api` creates a `fileIndex="max"` rollover strategy (the default strategy in Log4j 2.x).
   
   This problem was reported in the SO question [Log4j 1.2 Bridge update to 2.17.2 RollingFileAppender MaxBackupIndex Problem](https://stackoverflow.com/q/76787809/11748454).
   
   ## Affected version
   
   Versions `2.20.0` and `3.0.0-alpha1` are both affected.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Inverted rollover strategy in `log4j-1.2-api` (logging-log4j2)

Posted by "krzyk (via GitHub)" <gi...@apache.org>.
krzyk commented on issue #1650:
URL: https://github.com/apache/logging-log4j2/issues/1650#issuecomment-1688244585

   @ppkarwasz So, I assume this can be closed?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Inverted rollover strategy in `log4j-1.2-api` (logging-log4j2)

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on issue #1650:
URL: https://github.com/apache/logging-log4j2/issues/1650#issuecomment-1688303796

   Yes, of course.
   
   Usually Github closes the issue linked to a PR automatically, but it requires one of the accepted keywords in the PR's description (cf. [GitHub documentation](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Inverted rollover strategy in `log4j-1.2-api` (logging-log4j2)

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on issue #1650:
URL: https://github.com/apache/logging-log4j2/issues/1650#issuecomment-1660502164

   @krzyk,
   
   Sure, go ahead. Just remember to add a unity test, so we prevent future regressions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Inverted rollover strategy in `log4j-1.2-api` (logging-log4j2)

Posted by "krzyk (via GitHub)" <gi...@apache.org>.
krzyk commented on issue #1650:
URL: https://github.com/apache/logging-log4j2/issues/1650#issuecomment-1660444219

   Hi, could I work on  fix for this issue? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Inverted rollover strategy in `log4j-1.2-api` (logging-log4j2)

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz closed issue #1650: Inverted rollover strategy in `log4j-1.2-api`
URL: https://github.com/apache/logging-log4j2/issues/1650


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org