You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/09/11 06:26:00 UTC

[1/6] logging-log4j2 git commit: [LOG4J2-1573] Layout is no longer optional.

Repository: logging-log4j2
Updated Branches:
  refs/heads/LOG4J2-1349-gcfree-threadcontext 213ad7c4f -> 7ec63ce9b


[LOG4J2-1573] Layout is no longer optional.

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

Branch: refs/heads/LOG4J2-1349-gcfree-threadcontext
Commit: c6beb2e7e6fa2907f205100e4c56ee3a9f411fb3
Parents: f2a07e6
Author: Gary Gregory <gg...@apache.org>
Authored: Fri Sep 9 12:11:21 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Fri Sep 9 12:11:21 2016 -0700

----------------------------------------------------------------------
 log4j-core/src/test/resources/log4j2-1573.xml | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c6beb2e7/log4j-core/src/test/resources/log4j2-1573.xml
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/resources/log4j2-1573.xml b/log4j-core/src/test/resources/log4j2-1573.xml
new file mode 100644
index 0000000..880f3df
--- /dev/null
+++ b/log4j-core/src/test/resources/log4j2-1573.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration status="warn">
+   <Appenders>
+      <Console name="myConsole" target="SYSTEM_OUT"/>
+      <Async name="myConsoleAsync">
+         <AppenderRef ref="myConsole" />
+      </Async>
+   </Appenders>
+   <Loggers>
+      <AsyncRoot level="info" />
+   </Loggers>
+</Configuration>
\ No newline at end of file


[2/6] logging-log4j2 git commit: [LOG4J2-1574] Allow the RollingFileAppender to use default pattern layout.

Posted by rp...@apache.org.
[LOG4J2-1574] Allow the RollingFileAppender to use default pattern
layout. 

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

Branch: refs/heads/LOG4J2-1349-gcfree-threadcontext
Commit: 70f28f975507093fc0799b2743cf7eae6cc55f57
Parents: c6beb2e
Author: Gary Gregory <gg...@apache.org>
Authored: Fri Sep 9 12:38:04 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Fri Sep 9 12:38:04 2016 -0700

----------------------------------------------------------------------
 .../core/appender/RollingFileAppender.java      | 749 ++++++++++---------
 .../rolling/RollingFileAppenderLayoutTest.java  |  39 +
 src/changes/changes.xml                         |   3 +
 3 files changed, 417 insertions(+), 374 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/70f28f97/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
index b799d1c..0fc7a52 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingFileAppender.java
@@ -1,374 +1,375 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core.appender;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-import java.util.zip.Deflater;
-
-import org.apache.logging.log4j.core.Filter;
-import org.apache.logging.log4j.core.Layout;
-import org.apache.logging.log4j.core.LogEvent;
-import org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy;
-import org.apache.logging.log4j.core.appender.rolling.RollingFileManager;
-import org.apache.logging.log4j.core.appender.rolling.RolloverStrategy;
-import org.apache.logging.log4j.core.appender.rolling.TriggeringPolicy;
-import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.core.config.plugins.Plugin;
-import org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute;
-import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory;
-import org.apache.logging.log4j.core.config.plugins.PluginConfiguration;
-import org.apache.logging.log4j.core.config.plugins.PluginElement;
-import org.apache.logging.log4j.core.config.plugins.validation.constraints.Required;
-import org.apache.logging.log4j.core.net.Advertiser;
-import org.apache.logging.log4j.core.util.Booleans;
-import org.apache.logging.log4j.core.util.Integers;
-
-/**
- * An appender that writes to files and can roll over at intervals.
- */
-@Plugin(name = "RollingFile", category = "Core", elementType = "appender", printObject = true)
-public final class RollingFileAppender extends AbstractOutputStreamAppender<RollingFileManager> {
-
-    /**
-     * Builds FileAppender instances.
-     * 
-     * @param <B>
-     *            This builder class
-     */
-    public static class Builder<B extends Builder<B>> extends AbstractOutputStreamAppender.Builder<B>
-            implements org.apache.logging.log4j.core.util.Builder<RollingFileAppender> {
-
-        @PluginBuilderAttribute
-        @Required
-        private String fileName;
-
-        @PluginBuilderAttribute
-        @Required
-        private String filePattern;
-
-        @PluginBuilderAttribute
-        private boolean append = true;
-
-        @PluginBuilderAttribute
-        private boolean locking;
-
-        @PluginElement("Policy") 
-        @Required
-        private TriggeringPolicy policy;
-        
-        @PluginElement("Strategy") 
-        private RolloverStrategy strategy;
-
-        @PluginBuilderAttribute
-        private boolean advertise;
-
-        @PluginBuilderAttribute
-        private String advertiseUri;
-
-        @PluginBuilderAttribute
-        private boolean createOnDemand;
-
-        @PluginConfiguration
-        private Configuration configuration;
-
-        @Override
-        public RollingFileAppender build() {
-            // Even though some variables may be annotated with @Required, we must still perform validation here for
-            // call sites that build builders programmatically.
-            final boolean isBufferedIo = isBufferedIo();
-            final int bufferSize = getBufferSize();
-            if (getName() == null) {
-                LOGGER.error("RollingFileAppender '{}': No name provided.", getName());
-                return null;
-            }
-
-            if (!isBufferedIo && bufferSize > 0) {
-                LOGGER.warn("RollingFileAppender '{}': The bufferSize is set to {} but bufferedIO is not true", getName(), bufferSize);
-            }
-
-            if (fileName == null) {
-                LOGGER.error("RollingFileAppender '{}': No file name provided.", getName());
-                return null;
-            }
-
-            if (filePattern == null) {
-                LOGGER.error("RollingFileAppender '{}': No file name pattern provided.", getName());
-                return null;
-            }
-
-            if (policy == null) {
-                LOGGER.error("RollingFileAppender '{}': No TriggeringPolicy provided.", getName());
-                return null;
-            }
-
-            if (strategy == null) {
-                strategy = DefaultRolloverStrategy.createStrategy(null, null, null,
-                        String.valueOf(Deflater.DEFAULT_COMPRESSION), null, true, configuration);
-            }
-
-            if (strategy == null) {
-                strategy = DefaultRolloverStrategy.createStrategy(null, null, null,
-                        String.valueOf(Deflater.DEFAULT_COMPRESSION), null, true, configuration);
-            }
-
-            final RollingFileManager manager = RollingFileManager.getFileManager(fileName, filePattern, append,
-                    isBufferedIo, policy, strategy, advertiseUri, getLayout(), bufferSize, isImmediateFlush(),
-                    createOnDemand, configuration);
-            if (manager == null) {
-                return null;
-            }
-
-            manager.initialize();
-
-            return new RollingFileAppender(getName(), getLayout(), getFilter(), manager, fileName, filePattern,
-                    isIgnoreExceptions(), isImmediateFlush(), advertise ? configuration.getAdvertiser() : null);
-        }
-
-        public String getAdvertiseUri() {
-            return advertiseUri;
-        }
-
-        public Configuration getConfiguration() {
-            return configuration;
-        }
-
-        public String getFileName() {
-            return fileName;
-        }
-
-        public boolean isAdvertise() {
-            return advertise;
-        }
-
-        public boolean isAppend() {
-            return append;
-        }
-
-        public boolean isCreateOnDemand() {
-            return createOnDemand;
-        }
-
-        public boolean isLocking() {
-            return locking;
-        }
-
-        public B withAdvertise(final boolean advertise) {
-            this.advertise = advertise;
-            return asBuilder();
-        }
-
-        public B withAdvertiseUri(final String advertiseUri) {
-            this.advertiseUri = advertiseUri;
-            return asBuilder();
-        }
-
-        public B withAppend(final boolean append) {
-            this.append = append;
-            return asBuilder();
-        }
-
-        public B withConfiguration(final Configuration config) {
-            this.configuration = config;
-            return asBuilder();
-        }
-
-        public B withFileName(final String fileName) {
-            this.fileName = fileName;
-            return asBuilder();
-        }
-
-        public B withCreateOnDemand(final boolean createOnDemand) {
-            this.createOnDemand = createOnDemand;
-            return asBuilder();
-        }
-
-        public B withLocking(final boolean locking) {
-            this.locking = locking;
-            return asBuilder();
-        }
-
-        public String getFilePattern() {
-            return filePattern;
-        }
-
-        public TriggeringPolicy getPolicy() {
-            return policy;
-        }
-
-        public RolloverStrategy getStrategy() {
-            return strategy;
-        }
-
-        public B withFilePattern(final String filePattern) {
-            this.filePattern = filePattern;
-            return asBuilder();
-        }
-
-        public B withPolicy(final TriggeringPolicy policy) {
-            this.policy = policy;
-            return asBuilder();
-        }
-
-        public B withStrategy(final RolloverStrategy strategy) {
-            this.strategy = strategy;
-            return asBuilder();
-        }
-
-    }
-    
-    private static final int DEFAULT_BUFFER_SIZE = 8192;
-
-    private final String fileName;
-    private final String filePattern;
-    private Object advertisement;
-    private final Advertiser advertiser;
-
-    private RollingFileAppender(final String name, final Layout<? extends Serializable> layout, final Filter filter,
-            final RollingFileManager manager, final String fileName, final String filePattern,
-            final boolean ignoreExceptions, final boolean immediateFlush, final Advertiser advertiser) {
-        super(name, layout, filter, ignoreExceptions, immediateFlush, manager);
-        if (advertiser != null) {
-            final Map<String, String> configuration = new HashMap<>(layout.getContentFormat());
-            configuration.put("contentType", layout.getContentType());
-            configuration.put("name", name);
-            advertisement = advertiser.advertise(configuration);
-        }
-        this.fileName = fileName;
-        this.filePattern = filePattern;
-        this.advertiser = advertiser;
-    }
-
-    @Override
-    public boolean stop(final long timeout, final TimeUnit timeUnit) {
-        setStopping();
-        final boolean stopped = super.stop(timeout, timeUnit, false);
-        if (advertiser != null) {
-            advertiser.unadvertise(advertisement);
-        }
-        setStopped();
-        return stopped;
-    }
-
-    /**
-     * Writes the log entry rolling over the file when required.
-
-     * @param event The LogEvent.
-     */
-    @Override
-    public void append(final LogEvent event) {
-        getManager().checkRollover(event);
-        super.append(event);
-    }
-
-    /**
-     * Returns the File name for the Appender.
-     * @return The file name.
-     */
-    public String getFileName() {
-        return fileName;
-    }
-
-    /**
-     * Returns the file pattern used when rolling over.
-     * @return The file pattern.
-     */
-    public String getFilePattern() {
-        return filePattern;
-    }
-
-    /**
-     * Returns the triggering policy.
-     * @param <T> TriggeringPolicy type
-     * @return The TriggeringPolicy
-     */
-    public <T extends TriggeringPolicy> T getTriggeringPolicy() {
-        return getManager().getTriggeringPolicy();
-    }
-
-    /**
-     * Creates a RollingFileAppender.
-     * @param fileName The name of the file that is actively written to. (required).
-     * @param filePattern The pattern of the file name to use on rollover. (required).
-     * @param append If true, events are appended to the file. If false, the file
-     * is overwritten when opened. Defaults to "true"
-     * @param name The name of the Appender (required).
-     * @param bufferedIO When true, I/O will be buffered. Defaults to "true".
-     * @param bufferSizeStr buffer size for buffered IO (default is 8192).
-     * @param immediateFlush When true, events are immediately flushed. Defaults to "true".
-     * @param policy The triggering policy. (required).
-     * @param strategy The rollover strategy. Defaults to DefaultRolloverStrategy.
-     * @param layout The layout to use (defaults to the default PatternLayout).
-     * @param filter The Filter or null.
-     * @param ignore If {@code "true"} (default) exceptions encountered when appending events are logged; otherwise
-     *               they are propagated to the caller.
-     * @param advertise "true" if the appender configuration should be advertised, "false" otherwise.
-     * @param advertiseUri The advertised URI which can be used to retrieve the file contents.
-     * @param config The Configuration.
-     * @return A RollingFileAppender.
-     * @deprecated Use {@link #newBuilder()}.
-     */
-    @Deprecated
-    public static RollingFileAppender createAppender(
-            // @formatter:off
-            final String fileName,
-            final String filePattern,
-            final String append,
-            final String name,
-            final String bufferedIO,
-            final String bufferSizeStr,
-            final String immediateFlush,
-            final TriggeringPolicy policy,
-            final RolloverStrategy strategy,
-            final Layout<? extends Serializable> layout,
-            final Filter filter,
-            final String ignore,
-            final String advertise,
-            final String advertiseUri,
-            final Configuration config) {
-            // @formatter:on
-        final int bufferSize = Integers.parseInt(bufferSizeStr, DEFAULT_BUFFER_SIZE);
-        // @formatter:off
-        return newBuilder()
-                .withAdvertise(Boolean.parseBoolean(advertise))
-                .withAdvertiseUri(advertiseUri)
-                .withAppend(Booleans.parseBoolean(append, true))
-                .withBufferedIo(Booleans.parseBoolean(bufferedIO, true))
-                .withBufferSize(bufferSize)
-                .withConfiguration(config)
-                .withFileName(fileName)
-                .withFilePattern(filePattern)
-                .withFilter(filter)
-                .withIgnoreExceptions(Booleans.parseBoolean(ignore, true))
-                .withImmediateFlush(Booleans.parseBoolean(immediateFlush, true))
-                .withLayout(layout)
-                .withCreateOnDemand(false)
-                .withLocking(false)
-                .withName(name)
-                .withPolicy(policy)
-                .withStrategy(strategy)
-                .build();
-        // @formatter:on
-    }
-
-    @PluginBuilderFactory
-    public static <B extends Builder<B>> B newBuilder() {
-        return new Builder<B>().asBuilder();
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.core.appender;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import java.util.zip.Deflater;
+
+import org.apache.logging.log4j.core.Filter;
+import org.apache.logging.log4j.core.Layout;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy;
+import org.apache.logging.log4j.core.appender.rolling.RollingFileManager;
+import org.apache.logging.log4j.core.appender.rolling.RolloverStrategy;
+import org.apache.logging.log4j.core.appender.rolling.TriggeringPolicy;
+import org.apache.logging.log4j.core.config.Configuration;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+import org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute;
+import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory;
+import org.apache.logging.log4j.core.config.plugins.PluginConfiguration;
+import org.apache.logging.log4j.core.config.plugins.PluginElement;
+import org.apache.logging.log4j.core.config.plugins.validation.constraints.Required;
+import org.apache.logging.log4j.core.net.Advertiser;
+import org.apache.logging.log4j.core.util.Booleans;
+import org.apache.logging.log4j.core.util.Integers;
+
+/**
+ * An appender that writes to files and can roll over at intervals.
+ */
+@Plugin(name = "RollingFile", category = "Core", elementType = "appender", printObject = true)
+public final class RollingFileAppender extends AbstractOutputStreamAppender<RollingFileManager> {
+
+    /**
+     * Builds FileAppender instances.
+     * 
+     * @param <B>
+     *            This builder class
+     */
+    public static class Builder<B extends Builder<B>> extends AbstractOutputStreamAppender.Builder<B>
+            implements org.apache.logging.log4j.core.util.Builder<RollingFileAppender> {
+
+        @PluginBuilderAttribute
+        @Required
+        private String fileName;
+
+        @PluginBuilderAttribute
+        @Required
+        private String filePattern;
+
+        @PluginBuilderAttribute
+        private boolean append = true;
+
+        @PluginBuilderAttribute
+        private boolean locking;
+
+        @PluginElement("Policy") 
+        @Required
+        private TriggeringPolicy policy;
+        
+        @PluginElement("Strategy") 
+        private RolloverStrategy strategy;
+
+        @PluginBuilderAttribute
+        private boolean advertise;
+
+        @PluginBuilderAttribute
+        private String advertiseUri;
+
+        @PluginBuilderAttribute
+        private boolean createOnDemand;
+
+        @PluginConfiguration
+        private Configuration configuration;
+
+        @Override
+        public RollingFileAppender build() {
+            // Even though some variables may be annotated with @Required, we must still perform validation here for
+            // call sites that build builders programmatically.
+            final boolean isBufferedIo = isBufferedIo();
+            final int bufferSize = getBufferSize();
+            if (getName() == null) {
+                LOGGER.error("RollingFileAppender '{}': No name provided.", getName());
+                return null;
+            }
+
+            if (!isBufferedIo && bufferSize > 0) {
+                LOGGER.warn("RollingFileAppender '{}': The bufferSize is set to {} but bufferedIO is not true", getName(), bufferSize);
+            }
+
+            if (fileName == null) {
+                LOGGER.error("RollingFileAppender '{}': No file name provided.", getName());
+                return null;
+            }
+
+            if (filePattern == null) {
+                LOGGER.error("RollingFileAppender '{}': No file name pattern provided.", getName());
+                return null;
+            }
+
+            if (policy == null) {
+                LOGGER.error("RollingFileAppender '{}': No TriggeringPolicy provided.", getName());
+                return null;
+            }
+
+            if (strategy == null) {
+                strategy = DefaultRolloverStrategy.createStrategy(null, null, null,
+                        String.valueOf(Deflater.DEFAULT_COMPRESSION), null, true, configuration);
+            }
+
+            if (strategy == null) {
+                strategy = DefaultRolloverStrategy.createStrategy(null, null, null,
+                        String.valueOf(Deflater.DEFAULT_COMPRESSION), null, true, configuration);
+            }
+
+            final Layout<? extends Serializable> layout = getOrCreateLayout();
+            final RollingFileManager manager = RollingFileManager.getFileManager(fileName, filePattern, append,
+                    isBufferedIo, policy, strategy, advertiseUri, layout, bufferSize, isImmediateFlush(),
+                    createOnDemand, configuration);
+            if (manager == null) {
+                return null;
+            }
+
+            manager.initialize();
+
+            return new RollingFileAppender(getName(), layout, getFilter(), manager, fileName, filePattern,
+                    isIgnoreExceptions(), isImmediateFlush(), advertise ? configuration.getAdvertiser() : null);
+        }
+
+        public String getAdvertiseUri() {
+            return advertiseUri;
+        }
+
+        public Configuration getConfiguration() {
+            return configuration;
+        }
+
+        public String getFileName() {
+            return fileName;
+        }
+
+        public boolean isAdvertise() {
+            return advertise;
+        }
+
+        public boolean isAppend() {
+            return append;
+        }
+
+        public boolean isCreateOnDemand() {
+            return createOnDemand;
+        }
+
+        public boolean isLocking() {
+            return locking;
+        }
+
+        public B withAdvertise(final boolean advertise) {
+            this.advertise = advertise;
+            return asBuilder();
+        }
+
+        public B withAdvertiseUri(final String advertiseUri) {
+            this.advertiseUri = advertiseUri;
+            return asBuilder();
+        }
+
+        public B withAppend(final boolean append) {
+            this.append = append;
+            return asBuilder();
+        }
+
+        public B withConfiguration(final Configuration config) {
+            this.configuration = config;
+            return asBuilder();
+        }
+
+        public B withFileName(final String fileName) {
+            this.fileName = fileName;
+            return asBuilder();
+        }
+
+        public B withCreateOnDemand(final boolean createOnDemand) {
+            this.createOnDemand = createOnDemand;
+            return asBuilder();
+        }
+
+        public B withLocking(final boolean locking) {
+            this.locking = locking;
+            return asBuilder();
+        }
+
+        public String getFilePattern() {
+            return filePattern;
+        }
+
+        public TriggeringPolicy getPolicy() {
+            return policy;
+        }
+
+        public RolloverStrategy getStrategy() {
+            return strategy;
+        }
+
+        public B withFilePattern(final String filePattern) {
+            this.filePattern = filePattern;
+            return asBuilder();
+        }
+
+        public B withPolicy(final TriggeringPolicy policy) {
+            this.policy = policy;
+            return asBuilder();
+        }
+
+        public B withStrategy(final RolloverStrategy strategy) {
+            this.strategy = strategy;
+            return asBuilder();
+        }
+
+    }
+    
+    private static final int DEFAULT_BUFFER_SIZE = 8192;
+
+    private final String fileName;
+    private final String filePattern;
+    private Object advertisement;
+    private final Advertiser advertiser;
+
+    private RollingFileAppender(final String name, final Layout<? extends Serializable> layout, final Filter filter,
+            final RollingFileManager manager, final String fileName, final String filePattern,
+            final boolean ignoreExceptions, final boolean immediateFlush, final Advertiser advertiser) {
+        super(name, layout, filter, ignoreExceptions, immediateFlush, manager);
+        if (advertiser != null) {
+            final Map<String, String> configuration = new HashMap<>(layout.getContentFormat());
+            configuration.put("contentType", layout.getContentType());
+            configuration.put("name", name);
+            advertisement = advertiser.advertise(configuration);
+        }
+        this.fileName = fileName;
+        this.filePattern = filePattern;
+        this.advertiser = advertiser;
+    }
+
+    @Override
+    public boolean stop(final long timeout, final TimeUnit timeUnit) {
+        setStopping();
+        final boolean stopped = super.stop(timeout, timeUnit, false);
+        if (advertiser != null) {
+            advertiser.unadvertise(advertisement);
+        }
+        setStopped();
+        return stopped;
+    }
+
+    /**
+     * Writes the log entry rolling over the file when required.
+
+     * @param event The LogEvent.
+     */
+    @Override
+    public void append(final LogEvent event) {
+        getManager().checkRollover(event);
+        super.append(event);
+    }
+
+    /**
+     * Returns the File name for the Appender.
+     * @return The file name.
+     */
+    public String getFileName() {
+        return fileName;
+    }
+
+    /**
+     * Returns the file pattern used when rolling over.
+     * @return The file pattern.
+     */
+    public String getFilePattern() {
+        return filePattern;
+    }
+
+    /**
+     * Returns the triggering policy.
+     * @param <T> TriggeringPolicy type
+     * @return The TriggeringPolicy
+     */
+    public <T extends TriggeringPolicy> T getTriggeringPolicy() {
+        return getManager().getTriggeringPolicy();
+    }
+
+    /**
+     * Creates a RollingFileAppender.
+     * @param fileName The name of the file that is actively written to. (required).
+     * @param filePattern The pattern of the file name to use on rollover. (required).
+     * @param append If true, events are appended to the file. If false, the file
+     * is overwritten when opened. Defaults to "true"
+     * @param name The name of the Appender (required).
+     * @param bufferedIO When true, I/O will be buffered. Defaults to "true".
+     * @param bufferSizeStr buffer size for buffered IO (default is 8192).
+     * @param immediateFlush When true, events are immediately flushed. Defaults to "true".
+     * @param policy The triggering policy. (required).
+     * @param strategy The rollover strategy. Defaults to DefaultRolloverStrategy.
+     * @param layout The layout to use (defaults to the default PatternLayout).
+     * @param filter The Filter or null.
+     * @param ignore If {@code "true"} (default) exceptions encountered when appending events are logged; otherwise
+     *               they are propagated to the caller.
+     * @param advertise "true" if the appender configuration should be advertised, "false" otherwise.
+     * @param advertiseUri The advertised URI which can be used to retrieve the file contents.
+     * @param config The Configuration.
+     * @return A RollingFileAppender.
+     * @deprecated Use {@link #newBuilder()}.
+     */
+    @Deprecated
+    public static RollingFileAppender createAppender(
+            // @formatter:off
+            final String fileName,
+            final String filePattern,
+            final String append,
+            final String name,
+            final String bufferedIO,
+            final String bufferSizeStr,
+            final String immediateFlush,
+            final TriggeringPolicy policy,
+            final RolloverStrategy strategy,
+            final Layout<? extends Serializable> layout,
+            final Filter filter,
+            final String ignore,
+            final String advertise,
+            final String advertiseUri,
+            final Configuration config) {
+            // @formatter:on
+        final int bufferSize = Integers.parseInt(bufferSizeStr, DEFAULT_BUFFER_SIZE);
+        // @formatter:off
+        return newBuilder()
+                .withAdvertise(Boolean.parseBoolean(advertise))
+                .withAdvertiseUri(advertiseUri)
+                .withAppend(Booleans.parseBoolean(append, true))
+                .withBufferedIo(Booleans.parseBoolean(bufferedIO, true))
+                .withBufferSize(bufferSize)
+                .withConfiguration(config)
+                .withFileName(fileName)
+                .withFilePattern(filePattern)
+                .withFilter(filter)
+                .withIgnoreExceptions(Booleans.parseBoolean(ignore, true))
+                .withImmediateFlush(Booleans.parseBoolean(immediateFlush, true))
+                .withLayout(layout)
+                .withCreateOnDemand(false)
+                .withLocking(false)
+                .withName(name)
+                .withPolicy(policy)
+                .withStrategy(strategy)
+                .build();
+        // @formatter:on
+    }
+
+    @PluginBuilderFactory
+    public static <B extends Builder<B>> B newBuilder() {
+        return new Builder<B>().asBuilder();
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/70f28f97/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderLayoutTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderLayoutTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderLayoutTest.java
new file mode 100644
index 0000000..a3e3aad
--- /dev/null
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderLayoutTest.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.core.appender.rolling;
+
+import org.apache.logging.log4j.core.appender.RollingFileAppender;
+import org.apache.logging.log4j.core.config.DefaultConfiguration;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class RollingFileAppenderLayoutTest {
+
+    @Test
+    public void testDefaultLayout() throws Exception {
+        // @formatter:off
+        Assert.assertNotNull(RollingFileAppender.newBuilder()
+                .withName(RollingFileAppenderLayoutTest.class.getName())
+                .withConfiguration(new DefaultConfiguration())
+                .withFileName("log.txt")
+                .withFilePattern("FilePattern")
+                .withPolicy(OnStartupTriggeringPolicy.createPolicy(1))
+                .withCreateOnDemand(true) // no need to clutter up test folder with another file
+                .build().getLayout());
+        // @formatter:on
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/70f28f97/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 130df6e..269a19b 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -195,6 +195,9 @@
       <action issue="LOG4J2-1540" dev="ggregory" type="add" due-to="Gary Gregory">
         The Core AbstractManager should track its LoggerContext.
       </action>
+      <action issue="LOG4J2-1574" dev="ggregory" type="update">
+        Allow the RollingFileAppender to use default pattern layout. 
+      </action>
       <action issue="LOG4J2-1556" dev="ggregory" type="update">
         Custom Log4j threads should extend Log4jThread.
       </action>


[5/6] logging-log4j2 git commit: LOG4J2-1313 added failing test demonstrating the issue

Posted by rp...@apache.org.
LOG4J2-1313 added failing test demonstrating the issue


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

Branch: refs/heads/LOG4J2-1349-gcfree-threadcontext
Commit: a331f95e600c162d5adf503c1108982afbc825cc
Parents: 404e29f
Author: rpopma <rp...@apache.org>
Authored: Sun Sep 11 11:29:05 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Sep 11 11:29:05 2016 +0900

----------------------------------------------------------------------
 .../logging/log4j/core/config/PropertyTest.java | 63 ++++++++++++++++++++
 .../src/test/resources/configPropertyTest.xml   | 36 +++++++++++
 2 files changed, 99 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a331f95e/log4j-core/src/test/java/org/apache/logging/log4j/core/config/PropertyTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/PropertyTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/PropertyTest.java
new file mode 100644
index 0000000..a38382d
--- /dev/null
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/PropertyTest.java
@@ -0,0 +1,63 @@
+package org.apache.logging.log4j.core.config;/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+import java.util.List;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.test.appender.ListAppender;
+import org.junit.ClassRule;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Test for LOG4J2-1313
+ *  <Property name="" value="" /> not working
+ */
+public class PropertyTest {
+    private static final String CONFIG = "configPropertyTest.xml";
+
+    @ClassRule
+    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
+
+    @Test
+    public void testEmptyAttribute() throws Exception {
+        final org.apache.logging.log4j.Logger logger = LogManager.getLogger();
+        logger.info("msg");
+
+        final ListAppender app = (ListAppender) context.getRequiredAppender("List");
+        assertNotNull("No ListAppender", app);
+
+        final List<String> messages = app.getMessages();
+        assertNotNull("No Messages", messages);
+        assertEquals("message count" + messages, 1, messages.size());
+
+//        <Property name="elementKey">elementValue</Property>
+//        <Property name="emptyElementKey"></Property>
+//        <Property name="attributeKey" value="attributeValue" />
+//        <Property name="attributeWithEmptyElementKey" value="attributeValue2"></Property>
+//        <Property name="bothElementAndAttributeKey" value="attributeValue"3>elementValue</Property>
+        final String expect = "1=elementValue" + // ${sys:elementKey}
+                ",2=" + // ${sys:emptyElementKey}
+                ",3=attributeValue" + // ${sys:attributeKey}
+                ",4=attributeValue2" + // ${sys:attributeWithEmptyElementKey}
+                ",5=attributeValue3,m=msg"; // ${sys:bothElementAndAttributeKey}
+        assertEquals(expect, messages.get(0));
+        app.clear();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a331f95e/log4j-core/src/test/resources/configPropertyTest.xml
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/resources/configPropertyTest.xml b/log4j-core/src/test/resources/configPropertyTest.xml
new file mode 100644
index 0000000..04154d8
--- /dev/null
+++ b/log4j-core/src/test/resources/configPropertyTest.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License. You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<Configuration status="ERROR">
+  <Properties>
+    <Property name="elementKey">elementValue</Property>
+    <Property name="emptyElementKey"></Property>
+    <Property name="attributeKey" value="attributeValue" />
+    <Property name="attributeWithEmptyElementKey" value="attributeValue2"></Property>
+    <Property name="bothElementAndAttributeKey" value="attributeValue3">elementValue3</Property>
+  </Properties>
+  <Appenders>
+    <List name="List">
+      <PatternLayout pattern="1=${sys:elementKey},2=${sys:emptyElementKey},3=${sys:attributeKey},4=${sys:attributeWithEmptyElementKey},5=${sys:bothElementAndAttributeKey},m=%m" />
+    </List>
+  </Appenders>
+  <Loggers>
+    <Root level="trace">
+      <AppenderRef ref="List" />
+    </Root>
+  </Loggers>
+</Configuration>
\ No newline at end of file


[6/6] logging-log4j2 git commit: Merge branch 'master' into LOG4J2-1349-gcfree-threadcontext

Posted by rp...@apache.org.
Merge branch 'master' into LOG4J2-1349-gcfree-threadcontext


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

Branch: refs/heads/LOG4J2-1349-gcfree-threadcontext
Commit: 7ec63ce9b1eb0aff62777a559732382a959100c1
Parents: 213ad7c a331f95
Author: rpopma <rp...@apache.org>
Authored: Sun Sep 11 15:25:39 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Sep 11 15:25:39 2016 +0900

----------------------------------------------------------------------
 .../core/appender/RollingFileAppender.java      | 749 ++++++++++---------
 .../rolling/RollingFileAppenderLayoutTest.java  |  39 +
 .../logging/log4j/core/config/PropertyTest.java |  63 ++
 .../src/test/resources/configPropertyTest.xml   |  36 +
 log4j-core/src/test/resources/log4j2-1573.xml   |  12 +
 src/changes/announcement.vm                     |   6 +-
 src/changes/changes.xml                         | 157 ++--
 7 files changed, 608 insertions(+), 454 deletions(-)
----------------------------------------------------------------------



[3/6] logging-log4j2 git commit: Rephrased some change log entries to describe the change (including the reason) instead of the Jira title/problem description; removed due-to if same as developer

Posted by rp...@apache.org.
Rephrased some change log entries to describe the change (including the reason) instead of the Jira title/problem description; removed due-to if same as developer


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

Branch: refs/heads/LOG4J2-1349-gcfree-threadcontext
Commit: e1d05b5f6a69098b5a0f7d0c749a7c0607b17bf7
Parents: 70f28f9
Author: rpopma <rp...@apache.org>
Authored: Sat Sep 10 20:44:27 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sat Sep 10 20:44:27 2016 +0900

----------------------------------------------------------------------
 src/changes/changes.xml | 156 +++++++++++++++++++++----------------------
 1 file changed, 77 insertions(+), 79 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e1d05b5f/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 269a19b..9ade22b 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -25,13 +25,13 @@
   <body>
     <release version="2.7" date="2016-MM-DD" description="GA Release 2.7">
       <action issue="LOG4J2-1457" dev="mattsicker" type="fix" due-to="Leon Finker">
-        Class loader deadlock when using async logging and extended stack trace pattern.
+        Fixed class loader deadlock when using async logging and extended stack trace pattern.
       </action>
       <action issue="LOG4J2-1563" dev="ggregory" type="fix" due-to="Jason Tedor">
-        Log4j 2.6.2 can lose exceptions when a security manager is present.
+        Fix to prevent Log4j 2.6.2 and higher from losing exceptions when a security manager is present.
       </action>
       <action issue="LOG4J2-1530" dev="mikes" type="fix">
-        LogEvent.getContextStack() can return null.
+        Fixed issue where LogEvent.getContextStack() returned null.
       </action>
       <action issue="LOG4J2-1518" dev="rpopma" type="fix" due-to="Leon Finker">
         Prevent deadlock in Async Loggers when queue is full and logged Object's toString() logs another message.
@@ -40,64 +40,64 @@
         Prevent ArrayIndexOutOfBoundsException in ParameterizedMessage.formatTo for single-char or empty messages.
       </action>
       <action issue="LOG4J2-1549" dev="mikes" type="fix" due-to="Jason Bedard">
-        AsyncLoggerContextSelector+PropertiesConfigurationBuilder defaults to includeLocation=true.
+        Fixed issue where AsyncLoggerContextSelector+PropertiesConfigurationBuilder defaulted to includeLocation=true.
       </action>
       <action issue="LOG4J2-1562" dev="ggregory" type="fix">
-        SocketAppender memory usage grows unbounded if it cannot connect to a server.
+        Prevent SocketAppender memory usage from growing unbounded if it cannot connect to a server.
       </action>
       <action issue="LOG4J2-1559" dev="ggregory" type="fix" due-to="Andrey Plotkin">
-        NPE in Level.isInRange.
+        Prevent NPE in Level.isInRange.
       </action>
       <action issue="LOG4J2-1511" dev="ggregory" type="fix" due-to="Srikanth Surukuntu">
-        DynamicThresholdFilter filters incorrectly when params are passed as individual arguments instead of varargs.
+        DynamicThresholdFilter filtered incorrectly when params were passed as individual arguments instead of varargs.
       </action>
       <action issue="LOG4J2-1548" dev="ggregory" type="fix">
-        [CronTriggeringPolicy] ConfigurationScheduler schedules the task infinitely after first fire.
+        [CronTriggeringPolicy] ConfigurationScheduler scheduled the task infinitely after first fire.
       </action>
       <action issue="LOG4J2-1506" dev="ggregory" type="fix" due-to="Johannes Schleger">
-        Unregister JMX ignores log4j2.disable.jmx property.
+        Log4j should not unregister JMX MBeans when log4j2.disable.jmx property is true.
       </action>
-      <action issue="LOG4J2-1490" dev="ggregory" type="fix" due-to="Krzysztof Taborski, Gary Gregory">
-        Log4j2 is creating empty log files.
+      <action issue="LOG4J2-1490" dev="ggregory" type="fix" due-to="Krzysztof Taborski">
+        Log4j2 should postpone creating log file until the appender actually receives an event.
       </action>
-      <action issue="LOG4J2-1320" dev="ggregory" type="fix" due-to="Paresh Varke, Pierrick Hymbert, Gary Gregory">
-        Custom plugins are not loaded, URL protocol vfs is not supported.
+      <action issue="LOG4J2-1320" dev="ggregory" type="fix" due-to="Paresh Varke, Pierrick Hymbert">
+        Support loading custom plugins from jar files and directories whose classpath entries use the "vfs" URL protocol.
       </action>
       <action issue="LOG4J2-1541" dev="ggregory" type="fix">
         Fix file handle resource leak in XmlConfiguration.XmlConfiguration(ConfigurationSource).
       </action>
       <action issue="LOG4J2-1538" dev="ggregory" type="fix" due-to="Igor Karpov">
-        Dynamic removal of filter may cause NPE.
+        Prevent NPE when dynamically removing filters.
       </action>
       <action issue="LOG4J2-1532" dev="ggregory" type="fix">
-        Attributes are not merged properly in composite configurations.
+        Attributes were not merged properly in composite configurations.
       </action>
       <action issue="LOG4J2-1529" dev="mattsicker" type="fix" due-to="Sridevi Narra">
-        Attributes are not merged properly in composite configurations.
+        Attributes were not merged properly in composite configurations.
       </action>
       <action issue="LOG4J2-1527" dev="rpopma" type="fix" due-to="Jose Leon">
         Prevent NPE in RingBufferLogEvent.getFormattedMessage() when used in web applications.
       </action>
-      <action issue="LOG4J2-905" dev="ggregory" type="fix" due-to="Gary Gregory, Moritz L�ser">
-        Ability to disable (date) lookup completely, compatibility issues with other libraries like Camel.
+      <action issue="LOG4J2-905" dev="ggregory" type="fix" due-to="Moritz L�ser">
+        Added ability to disable (date) lookup completely for compatibility with other libraries like Camel.
       </action>
       <action issue="LOG4J2-1526" dev="mikes" type="fix">
-        Possibility to set StatusLogger destination in ConfigurationBuilder.
+        Added support for setting StatusLogger destination in ConfigurationBuilder.
       </action>
       <action issue="LOG4J2-1448" dev="rpopma" type="fix" due-to="Keith Laban">
         Allow comma separated agents, host list to be passed to FlumeAppender.
       </action>
       <action issue="LOG4J2-1500" dev="ggregory" type="fix" due-to="Jose Leon">
-        Merging configurations fail with an NPE when comparing Nodes with different attributes.
+        Merging configurations failed with an NPE when comparing Nodes with different attributes.
       </action>
-      <action issue="LOG4J2-1482" dev="ggregory" type="fix" due-to="Gary Gregory, Sumit Singhal">
-        Improper header in CsvParameterLayout.
+      <action issue="LOG4J2-1482" dev="ggregory" type="fix" due-to="Sumit Singhal">
+        Fixed improper header in CsvParameterLayout.
       </action>
       <action issue="LOG4J2-1199" dev="rpopma" type="fix">
-        Document that JVM Input Arguments Lookup (JMX) is not available on Google App Engine.
+        Documented that JVM Input Arguments Lookup (JMX) is not available on Google App Engine.
       </action>
       <action issue="LOG4J2-1438" dev="rpopma" type="fix">
-        (GC) Add method getParameter() to ObjectMessage (and ReusableObjectMessage).
+        (GC) Added method getParameter() to ObjectMessage (and ReusableObjectMessage).
       </action>
       <action issue="LOG4J2-1488" dev="rpopma" type="fix" due-to="Richard Zschech">
         (GC) Fixed ISO8601 %date conversion pattern with a period '.' separator for milliseconds is now garbage free.
@@ -112,127 +112,127 @@
         (GC) HighlightConverter and StyleConverter are now GC-free.
       </action>
       <action issue="LOG4J2-1467" dev="rpopma, ggregory" type="fix" due-to="Ralf, Gary Gregory">
-        [OSGi] Missing import package.
+        [OSGi] Fixed missing import package.
       </action>
       <action issue="LOG4J2-351" dev="rpopma, ggregory" type="fix" due-to="Roland Weiglhofer">
-        [OSGi] wrong Fragment-Host in manifest files.
+        [OSGi] Fixed wrong Fragment-Host in manifest files.
       </action>
       <action issue="LOG4J2-1313" dev="rpopma" type="fix" due-to="Philipp Knobel">
         Properties declared in configuration can now have their value either in the element body or in an attribute named "value".
       </action>
       <action issue="LOG4J2-1235" dev="ggregory" type="fix" due-to="Niranjan Rao, Sascha Scholz, Aleksey Zvolinsky">
-        org.apache.logging.log4j.core.appender.routing.IdlePurgePolicy not working correctly.
+        org.apache.logging.log4j.core.appender.routing.IdlePurgePolicy was not working correctly.
       </action>
       <action issue="LOG4J2-1502" dev="ggregory" type="fix" due-to="Sumit Singhal">
-        CsvParameterLayout and CsvLogEventLayout insert NUL characters if data starts with {, (, [ or "
+        Fixed issue where CsvParameterLayout and CsvLogEventLayout inserted NUL characters if data starts with {, (, [ or "
       </action>
       <action issue="LOG4J2-1568" dev="mattsicker" type="add">
-        Add support for java.util.concurrent.LinkedTransferQueue to AsyncAppender.
+        Added support for java.util.concurrent.LinkedTransferQueue to AsyncAppender.
       </action>
       <action issue="LOG4J2-1430" dev="mattsicker" type="add" due-to="John Cairns">
-        Add optional support for Conversant DisruptorBlockingQueue in AsyncAppender.
+        Added optional support for Conversant DisruptorBlockingQueue in AsyncAppender.
       </action>
       <action issue="LOG4J2-1439" dev="mattsicker" type="add" due-to="Anthony Maire">
-        Add optional support for JCTools in AsyncAppender.
+        Added optional support for JCTools MPSC bounded lock-free queue in AsyncAppender.
       </action>
       <action issue="LOG4J2-1558" dev="ggregory" type="add">
-        SocketAppender should support IO buffering.
+        SocketAppender now supports IO buffering.
       </action>
       <action issue="LOG4J2-1557" dev="ggregory" type="add">
-        Add a Builder for the SocketAppender (deprecates factory method).
+        Added a Builder for the SocketAppender (deprecates factory method).
       </action>
       <action issue="LOG4J2-1553" dev="ggregory" type="add">
-        AbstractManager should implement AutoCloseable.
+        AbstractManager now implements AutoCloseable.
       </action>
       <action issue="LOG4J2-1528" dev="mikes" type="add">
-        Create XML configuration file from ConfigurationBuilder.
+        Added ability to generate Log4j 2-style XML configuration file from ConfigurationBuilder.
       </action>
       <action issue="LOG4J2-1181" dev="mikes" type="add">
-        Scala API.
+        Added Logging API for Scala 2.10 and 2.11.
       </action>
       <action issue="LOG4J2-1512" dev="mikes" type="add">
-        Options to exclude stack trace from JSON, XML and YAML layouts.
+        Added options to exclude stack trace from JSON, XML and YAML layouts.
       </action>
-      <action issue="LOG4J2-1539" dev="ggregory" type="add" due-to="Gary Gregory">
-        Add Core API Configurator.shutdown(LoggerContext, long, TimeUnit).
+      <action issue="LOG4J2-1539" dev="ggregory" type="add">
+        Added Core API Configurator.shutdown(LoggerContext, long, TimeUnit).
       </action>
-      <action issue="LOG4J2-1501" dev="ggregory" type="add" due-to="Gary Gregory">
-        FileAppender should be able to create files on-demand.
+      <action issue="LOG4J2-1501" dev="ggregory" type="add">
+        FileAppender is now able to create files on-demand.
       </action>
-      <action issue="LOG4J2-1504" dev="ggregory" type="add" due-to="Gary Gregory">
-        RollingFileAppender should be able to create files on-demand.
+      <action issue="LOG4J2-1504" dev="ggregory" type="add">
+        RollingFileAppender is now able to create files on-demand.
       </action>
-      <action issue="LOG4J2-1471" dev="ggregory" type="add" due-to="Gary Gregory">
+      <action issue="LOG4J2-1471" dev="ggregory" type="add">
         [PatternLayout] Add an ANSI option to %xThrowable.
       </action>
-      <action issue="LOG4J2-1472" dev="ggregory" type="add" due-to="Gary Gregory">
-        Make org.apache.logging.log4j.core.LoggerContext implement Closeable.
+      <action issue="LOG4J2-1472" dev="ggregory" type="add">
+        org.apache.logging.log4j.core.LoggerContext now implements Closeable.
       </action>
-      <action issue="LOG4J2-1458" dev="ggregory" type="add" due-to="Gary Gregory">
+      <action issue="LOG4J2-1458" dev="ggregory" type="add">
         [PatternLayout] Add an ANSI option to %message.
       </action>
-      <action issue="LOG4J2-1505" dev="ggregory" type="add" due-to="Gary Gregory">
-        Create a Builder for FileAppender.
+      <action issue="LOG4J2-1505" dev="ggregory" type="add">
+        Create a Builder for the FileAppender plugin to facilitate adding attributes in the future.
       </action>
-      <action issue="LOG4J2-1507" dev="ggregory" type="add" due-to="Gary Gregory">
+      <action issue="LOG4J2-1507" dev="ggregory" type="add">
         Allow Builders to be completely generic.
       </action>
-      <action issue="LOG4J2-1508" dev="ggregory" type="add" due-to="Gary Gregory">
+      <action issue="LOG4J2-1508" dev="ggregory" type="add">
         Allow a Builder to subclass another Builder.
       </action>
       <action issue="LOG4J2-1516" dev="rpopma" type="add" due-to="Gary Gregory">
         Add ThreadContextMap2 interface supporting method putAll(Map&lt;String, String&gt;).
       </action>
-      <action issue="LOG4J2-1519" dev="ggregory" type="add" due-to="Gary Gregory">
+      <action issue="LOG4J2-1519" dev="ggregory" type="add">
         Add ThreadContext.putAll(Map&lt;String, String&gt;).
       </action>
-      <action issue="LOG4J2-1520" dev="ggregory" type="add" due-to="Gary Gregory">
+      <action issue="LOG4J2-1520" dev="ggregory" type="add">
         Add JUnit Rule implementations to manage the thread context.
       </action>
-      <action issue="LOG4J2-1547" dev="ggregory" type="add" due-to="Gary Gregory">
-        The Core AbstractConfiguration should track its LoggerContext and add Configuration.getLoggerContext().
+      <action issue="LOG4J2-1547" dev="ggregory" type="add">
+        The Core AbstractConfiguration now tracks its LoggerContext and add Configuration.getLoggerContext().
       </action>
-      <action issue="LOG4J2-1540" dev="ggregory" type="add" due-to="Gary Gregory">
-        The Core AbstractManager should track its LoggerContext.
+      <action issue="LOG4J2-1540" dev="ggregory" type="add">
+        The Core AbstractManager now tracks its LoggerContext.
       </action>
       <action issue="LOG4J2-1574" dev="ggregory" type="update">
-        Allow the RollingFileAppender to use default pattern layout. 
+        Allow the RollingFileAppender to use default pattern layout.
       </action>
       <action issue="LOG4J2-1556" dev="ggregory" type="update">
-        Custom Log4j threads should extend Log4jThread.
+        Custom Log4j threads now extend Log4jThread.
       </action>
       <action issue="LOG4J2-1458" dev="ggregory" type="update">
-        Update Jackson from 2.7.5 to 2.8.0.
+        Updated Jackson from 2.7.5 to 2.8.0.
       </action>
       <action issue="LOG4J2-1494" dev="ggregory" type="update">
-        Update Jackson from 2.8.0 to 2.8.1.
+        Updated Jackson from 2.8.0 to 2.8.1.
       </action>
       <action issue="LOG4J2-1569" dev="ggregory" type="update">
-        Update Jackson from 2.8.1 to 2.8.2.
+        Updated Jackson from 2.8.1 to 2.8.2.
       </action>
       <action issue="LOG4J2-1495" dev="ggregory" type="update">
-        Update LMAX Disruptor from 3.3.4 to 3.3.5.
+        Updated LMAX Disruptor from 3.3.4 to 3.3.5.
       </action>
       <action issue="LOG4J2-1496" dev="ggregory" type="update">
-        Update Kafka client from 0.9.1.0 to 0.10.0.0.
+        Updated Kafka client from 0.9.1.0 to 0.10.0.0.
       </action>
       <action issue="LOG4J2-1533" dev="ggregory" type="update">
-        Update Kafka client from 0.10.0.0 to 0.10.0.1.
+        Updated Kafka client from 0.10.0.0 to 0.10.0.1.
       </action>
       <action issue="LOG4J2-1487" dev="ggregory" type="update">
-        Update JMS test from ActiveMQ 5.13.3 to 5.13.4.
+        Updated JMS test from ActiveMQ 5.13.3 to 5.13.4.
       </action>
       <action issue="LOG4J2-1551" dev="ggregory" type="update">
-        Update JMS test from ActiveMQ 5.13.4 to 5.14.0.
+        Updated JMS test from ActiveMQ 5.13.4 to 5.14.0.
       </action>
       <action issue="LOG4J2-1543" dev="ggregory" type="update">
-        Remove deprecated Core API org.apache.logging.log4j.core.util.Constants.UTF_8.
+        Removed deprecated Core API org.apache.logging.log4j.core.util.Constants.UTF_8.
       </action>
       <action issue="LOG4J2-1544" dev="ggregory" type="update">
-        Remove deprecated Core API org.apache.logging.log4j.core.util.Assert.requireNonNull(T, String).
+        Removed deprecated Core API org.apache.logging.log4j.core.util.Assert.requireNonNull(T, String).
       </action>
       <action issue="LOG4J2-1545" dev="ggregory" type="update">
-        Remove deprecated Web API org.apache.logging.log4j.web.WebLookup.getServletContext().
+        Removed deprecated Web API org.apache.logging.log4j.web.WebLookup.getServletContext().
       </action>
     </release>
     <release version="2.6.2" date="2016-07-05" description="GA Release 2.6.2">
@@ -296,12 +296,10 @@
     </release>
     <release version="2.6.1" date="2016-06-05" description="GA Release 2.6.1">
       <action issue="LOG4J2-1405" dev="rgoers" type="fix">
-        OnStartupTriggeringPolicy was forcing a rollover of empty files at startup and would append a
-        second footer that was added by the prior shutdown.
+        OnStartupTriggeringPolicy was forcing a rollover of empty files at startup and would append a second footer that was added by the prior shutdown.
       </action>
       <action issue="LOG4J2-1406" dev="rpopma" type="fix" due-to="Trask Stalnaker">
-        Fixed bug in ReusableParameterizedMessage where Throwable was never updated so first error was logged over
-        and over again and subsequent errors were not logged.
+        Fixed bug in ReusableParameterizedMessage where Throwable was never updated so first error was logged over and over again and subsequent errors were not logged.
       </action>
       <action issue="LOG4J2-1409" dev="rpopma" type="fix" due-to="Shahan">
         Fixed ArrayIndexOutOfBoundsException that may occur in ReusableParameterizedMessage.
@@ -310,16 +308,16 @@
         Add filter and remove filter were not working properly in AbstractFilterable.
       </action>
       <action issue="LOG4J2-1032" dev="rgoers" type="fix">
-        Change RenameAction to use java.nio to better report rename failures.
+        Changed RenameAction to use java.nio to better report rename failures.
       </action>
       <action issue="LOG4J2-1407" dev="ggregory" type="fix">
-        Misleading WARN log events from Log4j about message factories and unexpected formatting.
+        Fixed misleading WARN log events from Log4j about message factories and unexpected formatting.
       </action>
       <action issue="LOG4J2-1408" dev="ggregory" type="fix">
-        The module log4j-liquibase is missing from BOM POM.
+        Added the module log4j-liquibase to BOM POM.
       </action>
       <action issue="LOG4J2-1180" dev="ggregory" type="fix">
-        Logger cache does not account for message factory.
+        Logger cache now accounts for message factory.
       </action>
       <action issue="LOG4J2-1402" dev="rgoers" type="fix">
         Fix regression in properties configuration to support arbitrary component ids.
@@ -334,7 +332,7 @@
         Update Apache Commons CSV from 1.3 to 1.4.
       </action>
       <action issue="LOG4J2-1411" dev="mattsicker" type="add">
-        Add documentation about plugin builders compared to factories.
+        Added documentation about plugin builders compared to factories.
       </action>
       <action issue="LOG4J2-1394" dev="mattsicker,mikes" type="fix">
         Fixed minor issues with the 2.6 web site.


[4/6] logging-log4j2 git commit: Added brief description on new features.

Posted by rp...@apache.org.
Added brief description on new features.


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

Branch: refs/heads/LOG4J2-1349-gcfree-threadcontext
Commit: 404e29fb2d8680f0574874db92abd60525fb70ba
Parents: e1d05b5
Author: rpopma <rp...@apache.org>
Authored: Sat Sep 10 20:55:18 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sat Sep 10 20:55:18 2016 +0900

----------------------------------------------------------------------
 src/changes/announcement.vm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/404e29fb/src/changes/announcement.vm
----------------------------------------------------------------------
diff --git a/src/changes/announcement.vm b/src/changes/announcement.vm
index 4fdaf0a..bacc509 100644
--- a/src/changes/announcement.vm
+++ b/src/changes/announcement.vm
@@ -28,8 +28,10 @@ property substitution using Lookups, multiple patterns on a PatternLayout and as
 Loggers. Another notable Log4j 2 feature is the ability to be "garbage-free" (avoid allocating
 temporary objects) while logging. In addition, Log4j 2 will not lose events while reconfiguring.
 
-This is the ${relCount} GA release. It is primarily a bugfix release. More details on the
-fixes are itemized below.
+This is the ${relCount} GA release. It contains several bugfixes and new features. The new
+features include new logging API modules for Scala 2.10 and 2.11, support for various
+non-blocking queue implementations in AsyncAppender. More details on the fixes are itemized
+below.
 
 Note that subsequent to the 2.6 release a minor source incompatibility was found due to the
 addition of new methods to the Logger interface. If you have code that does: