You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by sw...@apache.org on 2026/06/02 07:54:02 UTC
(logging-log4cxx) 01/01: RollingFileAppender could name the rolled file ".1"
This is an automated email from the ASF dual-hosted git repository.
swebb2066 pushed a commit to branch fix_rolling_file_appender
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
commit a483698d7164c8d59698d672c965147c3b4b38af
Author: Stephen Webb <sw...@gmail.com>
AuthorDate: Tue Jun 2 17:53:11 2026 +1000
RollingFileAppender could name the rolled file ".1"
---
src/main/cpp/rollingfileappender.cpp | 5 +++++
src/site/markdown/change-report-gh.md | 4 ++++
src/test/resources/input/rolling/obsoleteRFA1.properties | 4 ++--
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/main/cpp/rollingfileappender.cpp b/src/main/cpp/rollingfileappender.cpp
index c59dd793..197d67f8 100644
--- a/src/main/cpp/rollingfileappender.cpp
+++ b/src/main/cpp/rollingfileappender.cpp
@@ -194,6 +194,11 @@ bool RollingFileAppender::RollingFileAppenderPriv::activateOptions()
fwrp->setFileNamePattern(this->fileName + LOG4CXX_STR(".%i"));
this->rollingPolicy = fwrp;
}
+ else if (auto fwrp = LOG4CXX_NS::cast<FixedWindowRollingPolicy>(this->rollingPolicy))
+ {
+ 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