You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2022/01/26 10:06:00 UTC

[jira] [Resolved] (LOG4J2-3349) RollingFileAppenderBuilder in log4j1 bridge does not create the appender as in log4j1

     [ https://issues.apache.org/jira/browse/LOG4J2-3349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory resolved LOG4J2-3349.
-------------------------------------
    Fix Version/s: 2.17.2
       Resolution: Fixed

> RollingFileAppenderBuilder in log4j1 bridge does not create the appender as in log4j1
> -------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-3349
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3349
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Configuration
>    Affects Versions: 2.17.1
>            Reporter: Achim
>            Priority: Major
>             Fix For: 2.17.2
>
>
> [https://github.com/apache/logging-log4j2/blob/release-2.x/log4j-1.2-api/src/main/java/org/apache/log4j/builders/appender/RollingFileAppenderBuilder.java]
> creates the appender with a date filePattern.
> We are using a configuration like this
> {noformat}
> log4j.appender.file=org.apache.log4j.RollingFileAppender
> log4j.appender.file.layout=org.apache.log4j.PatternLayout
> log4j.appender.file.layout.ConversionPattern=%d{DEFAULT} [%t] %-5p %-33c{1} %x %m%n
> log4j.appender.file.File=foobar.log
> log4j.appender.file.MaxFileSize=200000KB
> log4j.appender.file.MaxBackupIndex=100
> {noformat}
> With log4j 1.2.17 this created rolled files
> foobar.log.1
> foobar.log.2
> etc
> With log4j2 and the bridge we get
> foobar.log2021-12-19
> We could live with the date pattern but it should produce 
> foobar.log.2021-12-19
> But since the rollover policy is still size-based what happens if the file is rolled twice a day?



--
This message was sent by Atlassian Jira
(v8.20.1#820001)