This is an automated email from the ASF dual-hosted git repository.
swebb2066 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
The following commit(s) were added to refs/heads/master by this push:
new 6b7db458 RollingFileAppender could name the rolled file ".1" (#703)
6b7db458 is described below
commit 6b7db4580492f22f21afb805c7ea36ec4de47b21
Author: Stephen Webb <[email protected]>
AuthorDate: Thu Jun 4 11:18:49 2026 +1000
RollingFileAppender could name the rolled file ".1" (#703)
---
src/main/cpp/rollingfileappender.cpp | 6 ++++++
src/site/markdown/change-report-gh.md | 4 ++++
src/test/resources/input/rolling/obsoleteRFA1.properties | 4 ++--
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/main/cpp/rollingfileappender.cpp
b/src/main/cpp/rollingfileappender.cpp
index c59dd793..b8408646 100644
--- a/src/main/cpp/rollingfileappender.cpp
+++ b/src/main/cpp/rollingfileappender.cpp
@@ -194,6 +194,12 @@ bool
RollingFileAppender::RollingFileAppenderPriv::activateOptions()
fwrp->setFileNamePattern(this->fileName + LOG4CXX_STR(".%i"));
this->rollingPolicy = fwrp;
}
+ else if (auto fwrp =
LOG4CXX_NS::cast<FixedWindowRollingPolicy>(this->rollingPolicy))
+ {
+ // Was fwrp created to store the maximum index before the file
name was set?
+ if (fwrp->getFileNamePattern() == LOG4CXX_STR(".%i"))
+ fwrp->setFileNamePattern(this->fileName +
LOG4CXX_STR(".%i"));
+ }
//
// if no explicit triggering policy and rolling policy is both.
diff --git a/src/site/markdown/change-report-gh.md
b/src/site/markdown/change-report-gh.md
index 51b5cef4..5fc8ec25 100644
--- a/src/site/markdown/change-report-gh.md
+++ b/src/site/markdown/change-report-gh.md
@@ -63,6 +63,7 @@ Release 1.8.0 includes the following new features:
, [#634](https://github.com/apache/logging-log4cxx/pull/634)
, [#642](https://github.com/apache/logging-log4cxx/pull/642)
, [#645](https://github.com/apache/logging-log4cxx/pull/645)
+ , [#669](https://github.com/apache/logging-log4cxx/pull/669)
The following issues have been addressed:
@@ -89,6 +90,9 @@ The following issues have been addressed:
* Console appender truncated a message containing an embedded null character
\[[#643](https://github.com/apache/logging-log4cxx/pull/643)\]
+* RollingFileAppender could name the rolled file ".1"
+ \[[#697](https://github.com/apache/logging-log4cxx/issues/697)\]
+
## Release 1.7.0 - 2026-04-04 {#rel_1_7_0}
Release 1.7.0 includes the following new features:
diff --git a/src/test/resources/input/rolling/obsoleteRFA1.properties
b/src/test/resources/input/rolling/obsoleteRFA1.properties
index 6fcc8dbe..8f8bed06 100644
--- a/src/test/resources/input/rolling/obsoleteRFA1.properties
+++ b/src/test/resources/input/rolling/obsoleteRFA1.properties
@@ -19,8 +19,8 @@ log4j.appender.testAppender.file=output/obsoleteRFA-test1.log
log4j.appender.testAppender.Append=false
log4j.appender.testAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.testAppender.layout.ConversionPattern=%m\n
-log4j.appender.testAppender.maxFileSize=100
-log4j.appender.testAppender.maxBackupIndex=3
+log4j.appender.testAppender.MaxFileSize=100
+log4j.appender.testAppender.MaxBackupIndex=3
# Prevent internal log4j DEBUG messages from polluting the output.
log4j.logger.org.apache.log4j.PropertyConfigurator=INFO