Repository: logging-log4j2
Updated Branches:
  refs/heads/master 71cab8985 -> f6f529a45


[LOG4J2-1523] Log4j 1 appenders. Classic RollingFileAppender with
property substitutions.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f6f529a4
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f6f529a4
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f6f529a4

Branch: refs/heads/master
Commit: f6f529a458ebb92c595d1340c19168a7a345719e
Parents: 71cab89
Author: Gary Gregory <ggreg...@apache.org>
Authored: Wed Sep 21 23:16:41 2016 -0700
Committer: Gary Gregory <ggreg...@apache.org>
Committed: Wed Sep 21 23:16:41 2016 -0700

----------------------------------------------------------------------
 .../org/apache/log4j/config/Log4j1ConfigurationParser.java   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f6f529a4/log4j-1.2-api/src/main/java/org/apache/log4j/config/Log4j1ConfigurationParser.java
----------------------------------------------------------------------
diff --git 
a/log4j-1.2-api/src/main/java/org/apache/log4j/config/Log4j1ConfigurationParser.java
 
b/log4j-1.2-api/src/main/java/org/apache/log4j/config/Log4j1ConfigurationParser.java
index 579e600..32c5166 100644
--- 
a/log4j-1.2-api/src/main/java/org/apache/log4j/config/Log4j1ConfigurationParser.java
+++ 
b/log4j-1.2-api/src/main/java/org/apache/log4j/config/Log4j1ConfigurationParser.java
@@ -168,18 +168,22 @@ public class Log4j1ConfigurationParser {
 
        private void buildFileAppender(final String appenderName) {
                final AppenderComponentBuilder appenderBuilder = 
builder.newAppender(appenderName, "File");
+               buildFileAppender(appenderName, appenderBuilder);
+               builder.add(appenderBuilder);
+       }
+
+       private void buildFileAppender(final String appenderName, final 
AppenderComponentBuilder appenderBuilder) {
                buildMandatoryAttribute(appenderName, appenderBuilder, "File", 
"fileName");
                buildAttribute(appenderName, appenderBuilder, "Append", 
"append");
                buildAttribute(appenderName, appenderBuilder, "BufferedIO", 
"bufferedIo");
                buildAttribute(appenderName, appenderBuilder, "BufferSize", 
"bufferSize");
                buildAttribute(appenderName, appenderBuilder, "ImmediateFlush", 
"immediateFlush");
                buildAppenderLayout(appenderName, appenderBuilder);
-               builder.add(appenderBuilder);
        }
 
        private void buildRollingFileAppender(final String appenderName) {
                final AppenderComponentBuilder appenderBuilder = 
builder.newAppender(appenderName, "RollingFile");
-               buildMandatoryAttribute(appenderName, appenderBuilder, "File", 
"fileName");
+               buildFileAppender(appenderName, appenderBuilder);
                final String fileName = getLog4jAppenderValue(appenderName, 
"File");
                appenderBuilder.addAttribute("filePattern", fileName + ".%i");
                final String maxFileSizeString = 
getLog4jAppenderValue(appenderName, "MaxFileSize", "10485760");

Reply via email to