You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by mi...@apache.org on 2016/10/24 08:08:12 UTC
[01/50] [abbrv] logging-log4j2 git commit: Use Appender.ELEMENT_TYPE
instead of magic string.
Repository: logging-log4j2
Updated Branches:
refs/heads/LOG4J2-1390 3fac1c7e9 -> 39e283369
Use Appender.ELEMENT_TYPE instead of magic string.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/5aa0313d
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/5aa0313d
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/5aa0313d
Branch: refs/heads/LOG4J2-1390
Commit: 5aa0313dbf4899c0f2c95bb86e3b9a0c8e2b14e6
Parents: e48898d
Author: Gary Gregory <gg...@apache.org>
Authored: Wed Sep 28 11:22:53 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Sep 28 11:22:53 2016 -0700
----------------------------------------------------------------------
.../org/apache/logging/log4j/core/appender/AppenderSet.java | 2 +-
.../apache/logging/log4j/core/appender/AsyncAppender.java | 2 +-
.../apache/logging/log4j/core/appender/ConsoleAppender.java | 3 ++-
.../logging/log4j/core/appender/CountingNoOpAppender.java | 3 ++-
.../logging/log4j/core/appender/FailoverAppender.java | 2 +-
.../apache/logging/log4j/core/appender/FileAppender.java | 3 ++-
.../log4j/core/appender/MemoryMappedFileAppender.java | 3 ++-
.../apache/logging/log4j/core/appender/NullAppender.java | 3 ++-
.../logging/log4j/core/appender/OutputStreamAppender.java | 3 ++-
.../log4j/core/appender/RandomAccessFileAppender.java | 3 ++-
.../logging/log4j/core/appender/RollingFileAppender.java | 3 ++-
.../core/appender/RollingRandomAccessFileAppender.java | 3 ++-
.../logging/log4j/core/appender/ScriptAppenderSelector.java | 2 +-
.../apache/logging/log4j/core/appender/SmtpAppender.java | 3 ++-
.../apache/logging/log4j/core/appender/SocketAppender.java | 3 ++-
.../apache/logging/log4j/core/appender/SyslogAppender.java | 3 ++-
.../apache/logging/log4j/core/appender/WriterAppender.java | 3 ++-
.../logging/log4j/core/appender/db/jdbc/JdbcAppender.java | 3 ++-
.../logging/log4j/core/appender/db/jpa/JpaAppender.java | 3 ++-
.../log4j/core/appender/rewrite/RewriteAppender.java | 2 +-
.../log4j/core/appender/routing/RoutingAppender.java | 4 ++--
.../config/properties/PropertiesConfigurationBuilder.java | 3 ++-
.../apache/logging/log4j/core/appender/HangingAppender.java | 9 +++++----
.../logging/log4j/test/appender/AlwaysFailAppender.java | 3 ++-
.../logging/log4j/test/appender/BlockingAppender.java | 3 ++-
.../logging/log4j/test/appender/DeadlockAppender.java | 3 ++-
.../logging/log4j/test/appender/FailOnceAppender.java | 3 ++-
.../apache/logging/log4j/test/appender/ListAppender.java | 3 ++-
.../logging/log4j/test/appender/UsesLoggingAppender.java | 3 ++-
.../apache/logging/log4j/flume/appender/FlumeAppender.java | 3 ++-
.../apache/logging/log4j/nosql/appender/NoSqlAppender.java | 3 ++-
31 files changed, 60 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java
index 4eed071..0aa6e35 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderSet.java
@@ -120,7 +120,7 @@ public class AppenderSet {
return null;
}
node.getAttributes().put("name", actualName);
- if (node.getType().getElementName().equals("appender")) {
+ if (node.getType().getElementName().equals(Appender.ELEMENT_TYPE)) {
final Node appNode = new Node(node);
configuration.createConfiguration(appNode, null);
if (appNode.getObject() instanceof Appender) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
index e6f7039..436664c 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
@@ -54,7 +54,7 @@ import org.apache.logging.log4j.core.util.Log4jThread;
* Appender to append to if the queue is full. The AsyncAppender does not allow a filter to be specified on the Appender
* references.
*/
-@Plugin(name = "Async", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "Async", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class AsyncAppender extends AbstractAppender {
private static final int DEFAULT_QUEUE_SIZE = 128;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
index e3f3c31..fec5997 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
@@ -27,6 +27,7 @@ import java.lang.reflect.Constructor;
import java.nio.charset.Charset;
import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.config.plugins.Plugin;
@@ -47,7 +48,7 @@ import org.apache.logging.log4j.util.PropertiesUtil;
* encoding. (RG) Encoding is handled within the Layout. Typically, a Layout will generate a String and then call
* getBytes which may use a configured encoding or the system default. OTOH, a Writer cannot print byte streams.
*/
-@Plugin(name = ConsoleAppender.PLUGIN_NAME, category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = ConsoleAppender.PLUGIN_NAME, category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class ConsoleAppender extends AbstractOutputStreamAppender<OutputStreamManager> {
public static final String PLUGIN_NAME = "Console";
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/CountingNoOpAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/CountingNoOpAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/CountingNoOpAppender.java
index 38775eb..89ff670 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/CountingNoOpAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/CountingNoOpAppender.java
@@ -19,6 +19,7 @@ package org.apache.logging.log4j.core.appender;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicLong;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.config.plugins.Plugin;
@@ -28,7 +29,7 @@ import org.apache.logging.log4j.core.config.plugins.PluginFactory;
/**
* No-Operation Appender that counts events.
*/
-@Plugin(name = "CountingNoOp", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "CountingNoOp", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public class CountingNoOpAppender extends AbstractAppender {
private final AtomicLong total = new AtomicLong();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
index b467d15..6fc0adb 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
@@ -41,7 +41,7 @@ import org.apache.logging.log4j.core.util.Constants;
* to a different appender. Hopefully it is obvious that the Appenders must be configured
* to not suppress exceptions for the FailoverAppender to work.
*/
-@Plugin(name = "Failover", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "Failover", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class FailoverAppender extends AbstractAppender {
private static final int DEFAULT_INTERVAL_SECONDS = 60;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
index 860f4e5..1c76ffb 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
@@ -21,6 +21,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.config.Configuration;
@@ -36,7 +37,7 @@ import org.apache.logging.log4j.core.util.Integers;
/**
* File Appender.
*/
-@Plugin(name = FileAppender.PLUGIN_NAME, category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = FileAppender.PLUGIN_NAME, category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class FileAppender extends AbstractOutputStreamAppender<FileManager> {
public static final String PLUGIN_NAME = "File";
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java
index c1f1aa6..f12e8b2 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java
@@ -21,6 +21,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LogEvent;
@@ -40,7 +41,7 @@ import org.apache.logging.log4j.core.util.Integers;
*
* @since 2.1
*/
-@Plugin(name = "MemoryMappedFile", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "MemoryMappedFile", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class MemoryMappedFileAppender extends AbstractOutputStreamAppender<MemoryMappedFileManager> {
private static final int BIT_POSITION_1GB = 30; // 2^30 ~= 1GB
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/NullAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/NullAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/NullAppender.java
index 47c2389..07a6250 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/NullAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/NullAppender.java
@@ -16,6 +16,7 @@
*/
package org.apache.logging.log4j.core.appender;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
@@ -24,7 +25,7 @@ import org.apache.logging.log4j.core.config.plugins.PluginFactory;
/**
* An Appender that ignores log events. Use for compatibility with version 1.2.
*/
-@Plugin(name = NullAppender.PLUGIN_NAME, category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = NullAppender.PLUGIN_NAME, category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public class NullAppender extends AbstractAppender {
public static final String PLUGIN_NAME = "Null";
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamAppender.java
index 53881bd..f9a2e66 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamAppender.java
@@ -19,6 +19,7 @@ package org.apache.logging.log4j.core.appender;
import java.io.OutputStream;
import java.io.Serializable;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.config.plugins.Plugin;
@@ -33,7 +34,7 @@ import org.apache.logging.log4j.core.util.CloseShieldOutputStream;
* Character encoding is handled within the Layout.
* </p>
*/
-@Plugin(name = "OutputStream", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "OutputStream", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class OutputStreamAppender extends AbstractOutputStreamAppender<OutputStreamManager> {
/**
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppender.java
index d852e51..0d9328d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppender.java
@@ -21,6 +21,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LogEvent;
@@ -38,7 +39,7 @@ import org.apache.logging.log4j.core.util.Integers;
/**
* File Appender.
*/
-@Plugin(name = "RandomAccessFile", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "RandomAccessFile", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class RandomAccessFileAppender extends AbstractOutputStreamAppender<RandomAccessFileManager> {
private final String fileName;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/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 f317b6b..93e8e2c 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
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.zip.Deflater;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LogEvent;
@@ -43,7 +44,7 @@ import org.apache.logging.log4j.core.util.Integers;
/**
* An appender that writes to files and can roll over at intervals.
*/
-@Plugin(name = RollingFileAppender.PLUGIN_NAME, category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = RollingFileAppender.PLUGIN_NAME, category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class RollingFileAppender extends AbstractOutputStreamAppender<RollingFileManager> {
public static final String PLUGIN_NAME = "RollingFile";
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java
index dae6efd..931ed4e 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.zip.Deflater;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LogEvent;
@@ -44,7 +45,7 @@ import org.apache.logging.log4j.core.util.Integers;
* An appender that writes to random access files and can roll over at
* intervals.
*/
-@Plugin(name = "RollingRandomAccessFile", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "RollingRandomAccessFile", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class RollingRandomAccessFileAppender extends AbstractOutputStreamAppender<RollingRandomAccessFileManager> {
private final String fileName;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ScriptAppenderSelector.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ScriptAppenderSelector.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ScriptAppenderSelector.java
index 7782b96..0bfd514 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ScriptAppenderSelector.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ScriptAppenderSelector.java
@@ -35,7 +35,7 @@ import org.apache.logging.log4j.core.config.plugins.validation.constraints.Requi
import org.apache.logging.log4j.core.script.AbstractScript;
import org.apache.logging.log4j.core.script.ScriptManager;
-@Plugin(name = "ScriptAppenderSelector", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "ScriptAppenderSelector", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public class ScriptAppenderSelector extends AbstractAppender {
/**
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SmtpAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SmtpAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SmtpAppender.java
index aed1153..87225de 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SmtpAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SmtpAppender.java
@@ -19,6 +19,7 @@ package org.apache.logging.log4j.core.appender;
import java.io.Serializable;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LogEvent;
@@ -52,7 +53,7 @@ import org.apache.logging.log4j.core.util.Booleans;
* message is appended. This can be modified by setting a filter for the
* appender.
*/
-@Plugin(name = "SMTP", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "SMTP", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class SmtpAppender extends AbstractAppender {
private static final int DEFAULT_BUFFER_SIZE = 512;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
index 744def0..c9d9c2f 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
@@ -21,6 +21,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LogEvent;
@@ -46,7 +47,7 @@ import org.apache.logging.log4j.core.util.Constants;
/**
* An Appender that delivers events over socket connections. Supports both TCP and UDP.
*/
-@Plugin(name = "Socket", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "Socket", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public class SocketAppender extends AbstractOutputStreamAppender<AbstractSocketManager> {
/**
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
index 0894a3e..5dca691 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SyslogAppender.java
@@ -19,6 +19,7 @@ package org.apache.logging.log4j.core.appender;
import java.io.Serializable;
import java.nio.charset.Charset;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.config.Configuration;
@@ -42,7 +43,7 @@ import org.apache.logging.log4j.util.EnglishEnums;
/**
* The Syslog Appender.
*/
-@Plugin(name = "Syslog", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "Syslog", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public class SyslogAppender extends SocketAppender {
protected static final String RFC5424 = "RFC5424";
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/WriterAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/WriterAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/WriterAppender.java
index b6e363a..e6a3b9d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/WriterAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/WriterAppender.java
@@ -18,6 +18,7 @@ package org.apache.logging.log4j.core.appender;
import java.io.Writer;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.StringLayout;
import org.apache.logging.log4j.core.config.plugins.Plugin;
@@ -29,7 +30,7 @@ import org.apache.logging.log4j.core.util.CloseShieldWriter;
/**
* Appends log events to a {@link Writer}.
*/
-@Plugin(name = "Writer", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "Writer", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class WriterAppender extends AbstractWriterAppender<WriterManager> {
/**
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppender.java
index 0359117..4846615 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppender.java
@@ -16,6 +16,7 @@
*/
package org.apache.logging.log4j.core.appender.db.jdbc;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender;
@@ -34,7 +35,7 @@ import org.apache.logging.log4j.core.util.Booleans;
* @see ColumnConfig
* @see ConnectionSource
*/
-@Plugin(name = "JDBC", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "JDBC", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class JdbcAppender extends AbstractDatabaseAppender<JdbcDatabaseManager> {
private final String description;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JpaAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JpaAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JpaAppender.java
index fa6a35f..0f1053f 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JpaAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jpa/JpaAppender.java
@@ -18,6 +18,7 @@ package org.apache.logging.log4j.core.appender.db.jpa;
import java.lang.reflect.Constructor;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.appender.AbstractAppender;
@@ -37,7 +38,7 @@ import org.apache.logging.log4j.util.Strings;
*
* @see AbstractLogEventWrapperEntity
*/
-@Plugin(name = "JPA", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "JPA", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class JpaAppender extends AbstractDatabaseAppender<JpaDatabaseManager> {
private final String description;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java
index 728939a..befc6b4 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rewrite/RewriteAppender.java
@@ -36,7 +36,7 @@ import org.apache.logging.log4j.core.util.Booleans;
/**
* This Appender allows the logging event to be manipulated before it is processed by other Appenders.
*/
-@Plugin(name = "Rewrite", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "Rewrite", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class RewriteAppender extends AbstractAppender {
private final Configuration config;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
index 8183d26..adc1543 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
@@ -50,7 +50,7 @@ import org.apache.logging.log4j.core.util.Booleans;
* the form "$${[key:]token}". The pattern will be resolved each time the Appender is called using
* the built in StrSubstitutor and the StrLookup plugin that matches the specified key.
*/
-@Plugin(name = "Routing", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "Routing", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class RoutingAppender extends AbstractAppender {
public static final String STATIC_VARIABLES_KEY = "staticVariables";
@@ -278,7 +278,7 @@ public final class RoutingAppender extends AbstractAppender {
private Appender createAppender(final Route route, final LogEvent event) {
final Node routeNode = route.getNode();
for (final Node node : routeNode.getChildren()) {
- if (node.getType().getElementName().equals("appender")) {
+ if (node.getType().getElementName().equals(Appender.ELEMENT_TYPE)) {
final Node appNode = new Node(node);
configuration.createConfiguration(appNode, event);
if (appNode.getObject() instanceof Appender) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java
index 63b093f..a4362b7 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java
@@ -21,6 +21,7 @@ import java.util.Map;
import java.util.Properties;
import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.ConfigurationException;
import org.apache.logging.log4j.core.config.ConfigurationSource;
@@ -148,7 +149,7 @@ public class PropertiesConfigurationBuilder extends ConfigurationBuilderFactory
}
} else {
final Map<String, Properties> appenders = PropertiesUtil
- .partitionOnCommonPrefixes(PropertiesUtil.extractSubset(rootProperties, "appender"));
+ .partitionOnCommonPrefixes(PropertiesUtil.extractSubset(rootProperties, Appender.ELEMENT_TYPE));
for (final Map.Entry<String, Properties> entry : appenders.entrySet()) {
builder.add(createAppender(entry.getKey().trim(), entry.getValue()));
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HangingAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HangingAppender.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HangingAppender.java
index 44f44c0..31891d3 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HangingAppender.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/HangingAppender.java
@@ -16,6 +16,10 @@
*/
package org.apache.logging.log4j.core.appender;
+import java.io.Serializable;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LogEvent;
@@ -25,10 +29,7 @@ import org.apache.logging.log4j.core.config.plugins.PluginElement;
import org.apache.logging.log4j.core.config.plugins.PluginFactory;
import org.apache.logging.log4j.core.config.plugins.validation.constraints.Required;
-import java.io.Serializable;
-import java.util.concurrent.TimeUnit;
-
-@Plugin(name = "Hanging", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "Hanging", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public class HangingAppender extends AbstractAppender {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/AlwaysFailAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/AlwaysFailAppender.java b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/AlwaysFailAppender.java
index 6d5fb11..666fca4 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/AlwaysFailAppender.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/AlwaysFailAppender.java
@@ -17,6 +17,7 @@
package org.apache.logging.log4j.test.appender;
import org.apache.logging.log4j.LoggingException;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.config.plugins.Plugin;
@@ -27,7 +28,7 @@ import org.apache.logging.log4j.core.config.plugins.validation.constraints.Requi
/**
*
*/
-@Plugin(name="AlwaysFail", category ="Core", elementType="appender", printObject=true)
+@Plugin(name="AlwaysFail", category ="Core", elementType=Appender.ELEMENT_TYPE, printObject=true)
public class AlwaysFailAppender extends AbstractAppender {
private AlwaysFailAppender(final String name) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/BlockingAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/BlockingAppender.java b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/BlockingAppender.java
index c863382..7c73ed0 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/BlockingAppender.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/BlockingAppender.java
@@ -18,6 +18,7 @@ package org.apache.logging.log4j.test.appender;
import java.util.concurrent.TimeUnit;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.config.plugins.Plugin;
@@ -28,7 +29,7 @@ import org.apache.logging.log4j.core.config.plugins.validation.constraints.Requi
/**
*
*/
-@Plugin(name="Block", category ="Core", elementType="appender", printObject=true)
+@Plugin(name="Block", category ="Core", elementType=Appender.ELEMENT_TYPE, printObject=true)
public class BlockingAppender extends AbstractAppender {
public volatile boolean running = true;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/DeadlockAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/DeadlockAppender.java b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/DeadlockAppender.java
index 57dc4d8..700ee8b 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/DeadlockAppender.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/DeadlockAppender.java
@@ -21,6 +21,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LoggingException;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.config.plugins.Plugin;
@@ -31,7 +32,7 @@ import org.apache.logging.log4j.core.config.plugins.validation.constraints.Requi
/**
*
*/
-@Plugin(name="Deadlock", category ="Core", elementType="appender", printObject=true)
+@Plugin(name="Deadlock", category ="Core", elementType=Appender.ELEMENT_TYPE, printObject=true)
public class DeadlockAppender extends AbstractAppender {
private WorkerThread thread = null;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/FailOnceAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/FailOnceAppender.java b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/FailOnceAppender.java
index ebe1617..95157b5 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/FailOnceAppender.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/FailOnceAppender.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.logging.log4j.LoggingException;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.config.plugins.Plugin;
@@ -30,7 +31,7 @@ import org.apache.logging.log4j.core.config.plugins.validation.constraints.Requi
/**
*
*/
-@Plugin(name="FailOnce", category ="Core", elementType="appender", printObject=true)
+@Plugin(name="FailOnce", category ="Core", elementType=Appender.ELEMENT_TYPE, printObject=true)
public class FailOnceAppender extends AbstractAppender {
boolean fail = true;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.java b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.java
index 64ed6af..05aa46e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/ListAppender.java
@@ -23,6 +23,7 @@ import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LogEvent;
@@ -46,7 +47,7 @@ import org.apache.logging.log4j.core.layout.SerializedLayout;
*
* @see org.apache.logging.log4j.junit.LoggerContextRule#getListAppender(String) ILC.getListAppender
*/
-@Plugin(name = "List", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "List", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public class ListAppender extends AbstractAppender {
// Use CopyOnWriteArrayList?
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/UsesLoggingAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/UsesLoggingAppender.java b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/UsesLoggingAppender.java
index 12b406b..44a264c 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/UsesLoggingAppender.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/UsesLoggingAppender.java
@@ -16,6 +16,7 @@
*/
package org.apache.logging.log4j.test.appender;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LogEvent;
@@ -30,7 +31,7 @@ import org.apache.logging.log4j.test.SomethingThatUsesLogging;
/**
*
*/
-@Plugin(name = "UsesLoggingAppender", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "UsesLoggingAppender", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class UsesLoggingAppender extends AbstractAppender {
private final SomethingThatUsesLogging thing;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
----------------------------------------------------------------------
diff --git a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java b/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
index a29df92..4524a26 100644
--- a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
+++ b/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeAppender.java
@@ -20,6 +20,7 @@ import java.io.Serializable;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.LogEvent;
@@ -38,7 +39,7 @@ import org.apache.logging.log4j.core.util.Integers;
/**
* An Appender that uses the Avro protocol to route events to Flume.
*/
-@Plugin(name = "Flume", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "Flume", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class FlumeAppender extends AbstractAppender implements FlumeEventFactory {
private static final String[] EXCLUDED_PACKAGES = {"org.apache.flume", "org.apache.avro"};
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5aa0313d/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlAppender.java
----------------------------------------------------------------------
diff --git a/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlAppender.java b/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlAppender.java
index bd2deb3..f562bbc 100644
--- a/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlAppender.java
+++ b/log4j-nosql/src/main/java/org/apache/logging/log4j/nosql/appender/NoSqlAppender.java
@@ -16,6 +16,7 @@
*/
package org.apache.logging.log4j.nosql.appender;
+import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender;
@@ -48,7 +49,7 @@ import org.apache.logging.log4j.core.util.Booleans;
* @see NoSqlConnection
* @see NoSqlProvider
*/
-@Plugin(name = "NoSql", category = "Core", elementType = "appender", printObject = true)
+@Plugin(name = "NoSql", category = "Core", elementType = Appender.ELEMENT_TYPE, printObject = true)
public final class NoSqlAppender extends AbstractDatabaseAppender<NoSqlDatabaseManager<?>> {
private final String description;
[06/50] [abbrv] logging-log4j2 git commit: Refactor magic strings.
Posted by mi...@apache.org.
Refactor magic strings.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/3a45025a
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/3a45025a
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/3a45025a
Branch: refs/heads/LOG4J2-1390
Commit: 3a45025a09dc2ae07a4df4be5df1a767a20a0a34
Parents: 0e15ec3
Author: Gary Gregory <gg...@apache.org>
Authored: Wed Sep 28 19:10:43 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Sep 28 19:10:43 2016 -0700
----------------------------------------------------------------------
----------------------------------------------------------------------
[14/50] [abbrv] logging-log4j2 git commit: Don't need to nest else
clause.
Posted by mi...@apache.org.
Don't need to nest else clause.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/003cada5
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/003cada5
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/003cada5
Branch: refs/heads/LOG4J2-1390
Commit: 003cada5de1188de6bc9879a599ae625d4a4e240
Parents: d7d1cf7
Author: Gary Gregory <gg...@apache.org>
Authored: Thu Sep 29 12:15:59 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu Sep 29 12:15:59 2016 -0700
----------------------------------------------------------------------
.../log4j/core/appender/SocketAppender.java | 33 ++++++++++----------
1 file changed, 16 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/003cada5/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
index c9d9c2f..8178ca0 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/SocketAppender.java
@@ -301,27 +301,26 @@ public class SocketAppender extends AbstractOutputStreamAppender<AbstractSocketM
.withSslConfiguration(sslConfig)
.build();
// @formatter:on
- } else {
- if (layout == null) {
- layout = SerializedLayout.createLayout();
- }
+ }
+ if (layout == null) {
+ layout = SerializedLayout.createLayout();
+ }
- if (name == null) {
- LOGGER.error("No name provided for SocketAppender");
- return null;
- }
+ if (name == null) {
+ LOGGER.error("No name provided for SocketAppender");
+ return null;
+ }
- final Protocol actualProtocol = protocol != null ? protocol : Protocol.TCP;
- if (actualProtocol == Protocol.UDP) {
- immediateFlush = true;
- }
+ final Protocol actualProtocol = protocol != null ? protocol : Protocol.TCP;
+ if (actualProtocol == Protocol.UDP) {
+ immediateFlush = true;
+ }
- final AbstractSocketManager manager = createSocketManager(name, actualProtocol, host, port,
- connectTimeoutMillis, sslConfig, reconnectDelayMillis, immediateFail, layout, Constants.ENCODER_BYTE_BUFFER_SIZE);
+ final AbstractSocketManager manager = createSocketManager(name, actualProtocol, host, port,
+ connectTimeoutMillis, sslConfig, reconnectDelayMillis, immediateFail, layout, Constants.ENCODER_BYTE_BUFFER_SIZE);
- return new SocketAppender(name, layout, filter, manager, ignoreExceptions, immediateFlush,
- advertise ? configuration.getAdvertiser() : null);
- }
+ return new SocketAppender(name, layout, filter, manager, ignoreExceptions, immediateFlush,
+ advertise ? configuration.getAdvertiser() : null);
}
/**
* Creates a socket appender.
[37/50] [abbrv] logging-log4j2 git commit: [LOG4J2-1636] Console
Appender does not pick up Oracle Java 8's sun.stdout.encoding and
sun.stderr.encoding. This is a partial fix. See discussion in Jira.
Posted by mi...@apache.org.
[LOG4J2-1636] Console Appender does not pick up Oracle Java 8's
sun.stdout.encoding and sun.stderr.encoding. This is a partial fix. See
discussion in Jira.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d65bf73c
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d65bf73c
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d65bf73c
Branch: refs/heads/LOG4J2-1390
Commit: d65bf73c02adbf7e82bd2dc66649bad512b944f2
Parents: eed7c07
Author: Gary Gregory <gg...@apache.org>
Authored: Mon Oct 10 11:20:32 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Mon Oct 10 11:20:32 2016 -0700
----------------------------------------------------------------------
.../logging/log4j/util/PropertiesUtil.java | 597 +-
.../log4j/core/appender/AbstractAppender.java | 8 +
.../log4j/core/appender/ConsoleAppender.java | 23 +-
.../appender/ConsoleAppenderBuilderTest.java | 80 +-
src/changes/changes.xml | 6175 +++++++++---------
5 files changed, 3477 insertions(+), 3406 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d65bf73c/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
index 1bc4e43..af0b29e 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
@@ -1,287 +1,310 @@
-/*
- * 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.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * <em>Consider this class private.</em>
- * <p>
- * Helps access properties. This utility provides a method to override system properties by specifying properties in a
- * properties file.
- * </p>
- */
-public final class PropertiesUtil {
-
- private static final PropertiesUtil LOG4J_PROPERTIES = new PropertiesUtil("log4j2.component.properties");
-
- private final Properties props;
-
- /**
- * Constructs a PropertiesUtil using a given Properties object as its source of defined properties.
- *
- * @param props the Properties to use by default
- */
- public PropertiesUtil(final Properties props) {
- this.props = props;
- }
-
- /**
- * Constructs a PropertiesUtil for a given properties file name on the classpath. The properties specified in this
- * file are used by default. If a property is not defined in this file, then the equivalent system property is used.
- *
- * @param propertiesFileName the location of properties file to load
- */
- public PropertiesUtil(final String propertiesFileName) {
- final Properties properties = new Properties();
- for (final URL url : LoaderUtil.findResources(propertiesFileName)) {
- try (final InputStream in = url.openStream()) {
- properties.load(in);
- } catch (final IOException ioe) {
- LowLevelLogUtil.logException("Unable to read " + url.toString(), ioe);
- }
- }
- this.props = properties;
- }
-
- /**
- * Loads and closes the given property input stream. If an error occurs, log to the status logger.
- *
- * @param in a property input stream.
- * @param source a source object describing the source, like a resource string or a URL.
- * @return a new Properties object
- */
- static Properties loadClose(final InputStream in, final Object source) {
- final Properties props = new Properties();
- if (null != in) {
- try {
- props.load(in);
- } catch (final IOException e) {
- LowLevelLogUtil.logException("Unable to read " + source, e);
- } finally {
- try {
- in.close();
- } catch (final IOException e) {
- LowLevelLogUtil.logException("Unable to close " + source, e);
- }
- }
- }
- return props;
- }
-
- /**
- * Returns the PropertiesUtil used by Log4j.
- *
- * @return the main Log4j PropertiesUtil instance.
- */
- public static PropertiesUtil getProperties() {
- return LOG4J_PROPERTIES;
- }
-
- /**
- * Gets the named property as a boolean value. If the property matches the string {@code "true"} (case-insensitive),
- * then it is returned as the boolean value {@code true}. Any other non-{@code null} text in the property is
- * considered {@code false}.
- *
- * @param name the name of the property to look up
- * @return the boolean value of the property or {@code false} if undefined.
- */
- public boolean getBooleanProperty(final String name) {
- return getBooleanProperty(name, false);
- }
-
- /**
- * Gets the named property as a boolean value.
- *
- * @param name the name of the property to look up
- * @param defaultValue the default value to use if the property is undefined
- * @return the boolean value of the property or {@code defaultValue} if undefined.
- */
- public boolean getBooleanProperty(final String name, final boolean defaultValue) {
- final String prop = getStringProperty(name);
- return (prop == null) ? defaultValue : "true".equalsIgnoreCase(prop);
- }
-
- /**
- * Gets the named property as a double.
- *
- * @param name the name of the property to look up
- * @param defaultValue the default value to use if the property is undefined
- * @return the parsed double value of the property or {@code defaultValue} if it was undefined or could not be parsed.
- */
- public double getDoubleProperty(final String name, final double defaultValue) {
- final String prop = getStringProperty(name);
- if (prop != null) {
- try {
- return Double.parseDouble(prop);
- } catch (final Exception ignored) {
- return defaultValue;
- }
- }
- return defaultValue;
- }
-
- /**
- * Gets the named property as an integer.
- *
- * @param name the name of the property to look up
- * @param defaultValue the default value to use if the property is undefined
- * @return the parsed integer value of the property or {@code defaultValue} if it was undefined or could not be
- * parsed.
- */
- public int getIntegerProperty(final String name, final int defaultValue) {
- final String prop = getStringProperty(name);
- if (prop != null) {
- try {
- return Integer.parseInt(prop);
- } catch (final Exception ignored) {
- return defaultValue;
- }
- }
- return defaultValue;
- }
-
- /**
- * Gets the named property as a long.
- *
- * @param name the name of the property to look up
- * @param defaultValue the default value to use if the property is undefined
- * @return the parsed long value of the property or {@code defaultValue} if it was undefined or could not be parsed.
- */
- public long getLongProperty(final String name, final long defaultValue) {
- final String prop = getStringProperty(name);
- if (prop != null) {
- try {
- return Long.parseLong(prop);
- } catch (final Exception ignored) {
- return defaultValue;
- }
- }
- return defaultValue;
- }
-
- /**
- * Gets the named property as a String.
- *
- * @param name the name of the property to look up
- * @return the String value of the property or {@code null} if undefined.
- */
- public String getStringProperty(final String name) {
- String prop = null;
- try {
- prop = System.getProperty(name);
- } catch (final SecurityException ignored) {
- // Ignore
- }
- return prop == null ? props.getProperty(name) : prop;
- }
-
- /**
- * Gets the named property as a String.
- *
- * @param name the name of the property to look up
- * @param defaultValue the default value to use if the property is undefined
- * @return the String value of the property or {@code defaultValue} if undefined.
- */
- public String getStringProperty(final String name, final String defaultValue) {
- final String prop = getStringProperty(name);
- return (prop == null) ? defaultValue : prop;
- }
-
- /**
- * Return the system properties or an empty Properties object if an error occurs.
- *
- * @return The system properties.
- */
- public static Properties getSystemProperties() {
- try {
- return new Properties(System.getProperties());
- } catch (final SecurityException ex) {
- LowLevelLogUtil.logException("Unable to access system properties.", ex);
- // Sandboxed - can't read System Properties
- return new Properties();
- }
- }
-
- /**
- * Extracts properties that start with or are equals to the specific prefix and returns them in a new Properties
- * object with the prefix removed.
- *
- * @param properties The Properties to evaluate.
- * @param prefix The prefix to extract.
- * @return The subset of properties.
- */
- public static Properties extractSubset(final Properties properties, final String prefix) {
- final Properties subset = new Properties();
-
- if (prefix == null || prefix.length() == 0) {
- return subset;
- }
-
- final String prefixToMatch = prefix.charAt(prefix.length() - 1) != '.' ? prefix + '.' : prefix;
-
- final List<String> keys = new ArrayList<>();
-
- for (final String key : properties.stringPropertyNames()) {
- if (key.startsWith(prefixToMatch)) {
- subset.setProperty(key.substring(prefixToMatch.length()), properties.getProperty(key));
- keys.add(key);
- }
- }
- for (final String key : keys) {
- properties.remove(key);
- }
-
- return subset;
- }
-
- /**
- * Partitions a properties map based on common key prefixes up to the first period.
- *
- * @param properties properties to partition
- * @return the partitioned properties where each key is the common prefix (minus the period) and the values are
- * new property maps without the prefix and period in the key
- * @since 2.6
- */
- public static Map<String, Properties> partitionOnCommonPrefixes(final Properties properties) {
- final Map<String, Properties> parts = new ConcurrentHashMap<>();
- for (final String key : properties.stringPropertyNames()) {
- final String prefix = key.substring(0, key.indexOf('.'));
- if (!parts.containsKey(prefix)) {
- parts.put(prefix, new Properties());
- }
- parts.get(prefix).setProperty(key.substring(key.indexOf('.') + 1), properties.getProperty(key));
- }
- return parts;
- }
-
- /**
- * Returns true if system properties tell us we are running on Windows.
- * @return true if system properties tell us we are running on Windows.
- */
- public boolean isOsWindows() {
- return getStringProperty("os.name").startsWith("Windows");
- }
-
-}
+/*
+ * 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.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * <em>Consider this class private.</em>
+ * <p>
+ * Helps access properties. This utility provides a method to override system properties by specifying properties in a
+ * properties file.
+ * </p>
+ */
+public final class PropertiesUtil {
+
+ private static final PropertiesUtil LOG4J_PROPERTIES = new PropertiesUtil("log4j2.component.properties");
+
+ private final Properties props;
+
+ /**
+ * Constructs a PropertiesUtil using a given Properties object as its source of defined properties.
+ *
+ * @param props the Properties to use by default
+ */
+ public PropertiesUtil(final Properties props) {
+ this.props = props;
+ }
+
+ /**
+ * Constructs a PropertiesUtil for a given properties file name on the classpath. The properties specified in this
+ * file are used by default. If a property is not defined in this file, then the equivalent system property is used.
+ *
+ * @param propertiesFileName the location of properties file to load
+ */
+ public PropertiesUtil(final String propertiesFileName) {
+ final Properties properties = new Properties();
+ for (final URL url : LoaderUtil.findResources(propertiesFileName)) {
+ try (final InputStream in = url.openStream()) {
+ properties.load(in);
+ } catch (final IOException ioe) {
+ LowLevelLogUtil.logException("Unable to read " + url.toString(), ioe);
+ }
+ }
+ this.props = properties;
+ }
+
+ /**
+ * Loads and closes the given property input stream. If an error occurs, log to the status logger.
+ *
+ * @param in a property input stream.
+ * @param source a source object describing the source, like a resource string or a URL.
+ * @return a new Properties object
+ */
+ static Properties loadClose(final InputStream in, final Object source) {
+ final Properties props = new Properties();
+ if (null != in) {
+ try {
+ props.load(in);
+ } catch (final IOException e) {
+ LowLevelLogUtil.logException("Unable to read " + source, e);
+ } finally {
+ try {
+ in.close();
+ } catch (final IOException e) {
+ LowLevelLogUtil.logException("Unable to close " + source, e);
+ }
+ }
+ }
+ return props;
+ }
+
+ /**
+ * Returns the PropertiesUtil used by Log4j.
+ *
+ * @return the main Log4j PropertiesUtil instance.
+ */
+ public static PropertiesUtil getProperties() {
+ return LOG4J_PROPERTIES;
+ }
+
+ /**
+ * Gets the named property as a boolean value. If the property matches the string {@code "true"} (case-insensitive),
+ * then it is returned as the boolean value {@code true}. Any other non-{@code null} text in the property is
+ * considered {@code false}.
+ *
+ * @param name the name of the property to look up
+ * @return the boolean value of the property or {@code false} if undefined.
+ */
+ public boolean getBooleanProperty(final String name) {
+ return getBooleanProperty(name, false);
+ }
+
+ /**
+ * Gets the named property as a boolean value.
+ *
+ * @param name the name of the property to look up
+ * @param defaultValue the default value to use if the property is undefined
+ * @return the boolean value of the property or {@code defaultValue} if undefined.
+ */
+ public boolean getBooleanProperty(final String name, final boolean defaultValue) {
+ final String prop = getStringProperty(name);
+ return (prop == null) ? defaultValue : "true".equalsIgnoreCase(prop);
+ }
+
+ /**
+ * Gets the named property as a Charset value.
+ *
+ * @param name the name of the property to look up
+ * @return the Charset value of the property or {@link Charset#defaultCharset()} if undefined.
+ */
+ public Charset getCharsetProperty(final String name) {
+ return getCharsetProperty(name, Charset.defaultCharset());
+ }
+
+ /**
+ * Gets the named property as a Charset value.
+ *
+ * @param name the name of the property to look up
+ * @param defaultValue the default value to use if the property is undefined
+ * @return the Charset value of the property or {@code defaultValue} if undefined.
+ */
+ public Charset getCharsetProperty(String name, Charset defaultValue) {
+ final String prop = getStringProperty(name);
+ return prop == null ? defaultValue : Charset.forName(name);
+ }
+
+ /**
+ * Gets the named property as a double.
+ *
+ * @param name the name of the property to look up
+ * @param defaultValue the default value to use if the property is undefined
+ * @return the parsed double value of the property or {@code defaultValue} if it was undefined or could not be parsed.
+ */
+ public double getDoubleProperty(final String name, final double defaultValue) {
+ final String prop = getStringProperty(name);
+ if (prop != null) {
+ try {
+ return Double.parseDouble(prop);
+ } catch (final Exception ignored) {
+ return defaultValue;
+ }
+ }
+ return defaultValue;
+ }
+
+ /**
+ * Gets the named property as an integer.
+ *
+ * @param name the name of the property to look up
+ * @param defaultValue the default value to use if the property is undefined
+ * @return the parsed integer value of the property or {@code defaultValue} if it was undefined or could not be
+ * parsed.
+ */
+ public int getIntegerProperty(final String name, final int defaultValue) {
+ final String prop = getStringProperty(name);
+ if (prop != null) {
+ try {
+ return Integer.parseInt(prop);
+ } catch (final Exception ignored) {
+ return defaultValue;
+ }
+ }
+ return defaultValue;
+ }
+
+ /**
+ * Gets the named property as a long.
+ *
+ * @param name the name of the property to look up
+ * @param defaultValue the default value to use if the property is undefined
+ * @return the parsed long value of the property or {@code defaultValue} if it was undefined or could not be parsed.
+ */
+ public long getLongProperty(final String name, final long defaultValue) {
+ final String prop = getStringProperty(name);
+ if (prop != null) {
+ try {
+ return Long.parseLong(prop);
+ } catch (final Exception ignored) {
+ return defaultValue;
+ }
+ }
+ return defaultValue;
+ }
+
+ /**
+ * Gets the named property as a String.
+ *
+ * @param name the name of the property to look up
+ * @return the String value of the property or {@code null} if undefined.
+ */
+ public String getStringProperty(final String name) {
+ String prop = null;
+ try {
+ prop = System.getProperty(name);
+ } catch (final SecurityException ignored) {
+ // Ignore
+ }
+ return prop == null ? props.getProperty(name) : prop;
+ }
+
+ /**
+ * Gets the named property as a String.
+ *
+ * @param name the name of the property to look up
+ * @param defaultValue the default value to use if the property is undefined
+ * @return the String value of the property or {@code defaultValue} if undefined.
+ */
+ public String getStringProperty(final String name, final String defaultValue) {
+ final String prop = getStringProperty(name);
+ return (prop == null) ? defaultValue : prop;
+ }
+
+ /**
+ * Return the system properties or an empty Properties object if an error occurs.
+ *
+ * @return The system properties.
+ */
+ public static Properties getSystemProperties() {
+ try {
+ return new Properties(System.getProperties());
+ } catch (final SecurityException ex) {
+ LowLevelLogUtil.logException("Unable to access system properties.", ex);
+ // Sandboxed - can't read System Properties
+ return new Properties();
+ }
+ }
+
+ /**
+ * Extracts properties that start with or are equals to the specific prefix and returns them in a new Properties
+ * object with the prefix removed.
+ *
+ * @param properties The Properties to evaluate.
+ * @param prefix The prefix to extract.
+ * @return The subset of properties.
+ */
+ public static Properties extractSubset(final Properties properties, final String prefix) {
+ final Properties subset = new Properties();
+
+ if (prefix == null || prefix.length() == 0) {
+ return subset;
+ }
+
+ final String prefixToMatch = prefix.charAt(prefix.length() - 1) != '.' ? prefix + '.' : prefix;
+
+ final List<String> keys = new ArrayList<>();
+
+ for (final String key : properties.stringPropertyNames()) {
+ if (key.startsWith(prefixToMatch)) {
+ subset.setProperty(key.substring(prefixToMatch.length()), properties.getProperty(key));
+ keys.add(key);
+ }
+ }
+ for (final String key : keys) {
+ properties.remove(key);
+ }
+
+ return subset;
+ }
+
+ /**
+ * Partitions a properties map based on common key prefixes up to the first period.
+ *
+ * @param properties properties to partition
+ * @return the partitioned properties where each key is the common prefix (minus the period) and the values are
+ * new property maps without the prefix and period in the key
+ * @since 2.6
+ */
+ public static Map<String, Properties> partitionOnCommonPrefixes(final Properties properties) {
+ final Map<String, Properties> parts = new ConcurrentHashMap<>();
+ for (final String key : properties.stringPropertyNames()) {
+ final String prefix = key.substring(0, key.indexOf('.'));
+ if (!parts.containsKey(prefix)) {
+ parts.put(prefix, new Properties());
+ }
+ parts.get(prefix).setProperty(key.substring(key.indexOf('.') + 1), properties.getProperty(key));
+ }
+ return parts;
+ }
+
+ /**
+ * Returns true if system properties tell us we are running on Windows.
+ * @return true if system properties tell us we are running on Windows.
+ */
+ public boolean isOsWindows() {
+ return getStringProperty("os.name").startsWith("Windows");
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d65bf73c/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
index 71af242..94f2fec 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
@@ -17,6 +17,7 @@
package org.apache.logging.log4j.core.appender;
import java.io.Serializable;
+import java.nio.charset.Charset;
import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.ErrorHandler;
@@ -87,6 +88,13 @@ public abstract class AbstractAppender extends AbstractFilterable implements App
return layout;
}
+ public Layout<? extends Serializable> getOrCreateLayout(Charset charset) {
+ if (layout == null) {
+ return PatternLayout.newBuilder().withCharset(charset).build();
+ }
+ return layout;
+ }
+
}
private final String name;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d65bf73c/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
index fec5997..b865caf 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
@@ -64,9 +64,26 @@ public final class ConsoleAppender extends AbstractOutputStreamAppender<OutputSt
*/
public enum Target {
/** Standard output. */
- SYSTEM_OUT,
+ SYSTEM_OUT {
+ @Override
+ public Charset getDefaultCharset() {
+ return getCharset("sun.stdout.encoding");
+ }
+ },
/** Standard error output. */
- SYSTEM_ERR
+ SYSTEM_ERR {
+ @Override
+ public Charset getDefaultCharset() {
+ return getCharset("sun.stderr.encoding");
+ }
+ };
+
+ public abstract Charset getDefaultCharset();
+
+ protected Charset getCharset(String property) {
+ return new PropertiesUtil(PropertiesUtil.getSystemProperties()).getCharsetProperty(property);
+ }
+
}
private ConsoleAppender(final String name, final Layout<? extends Serializable> layout, final Filter filter,
@@ -197,7 +214,7 @@ public final class ConsoleAppender extends AbstractOutputStreamAppender<OutputSt
if (follow && direct) {
throw new IllegalArgumentException("Cannot use both follow and direct on ConsoleAppender '" + getName() + "'");
}
- final Layout<? extends Serializable> layout = getOrCreateLayout();
+ final Layout<? extends Serializable> layout = getOrCreateLayout(target.getDefaultCharset());
return new ConsoleAppender(getName(), layout, getFilter(), getManager(target, follow, direct, layout),
isIgnoreExceptions(), target);
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d65bf73c/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java
index 2531a31..157b8c0 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java
@@ -1,31 +1,49 @@
-/*
- * 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 org.junit.Assert;
-import org.junit.Test;
-
-public class ConsoleAppenderBuilderTest {
-
- /**
- * Tests https://issues.apache.org/jira/browse/LOG4J2-1620
- */
- @Test
- public void testDefaultImmediateFlush() {
- Assert.assertTrue(ConsoleAppender.newBuilder().isImmediateFlush());
- }
-}
+/*
+ * 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.nio.charset.Charset;
+
+import org.apache.logging.log4j.core.layout.PatternLayout;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ConsoleAppenderBuilderTest {
+
+ /**
+ * Tests https://issues.apache.org/jira/browse/LOG4J2-1620
+ */
+ @Test
+ public void testDefaultImmediateFlush() {
+ Assert.assertTrue(ConsoleAppender.newBuilder().isImmediateFlush());
+ }
+
+ /**
+ * Tests https://issues.apache.org/jira/browse/LOG4J2-1636
+ *
+ * Tested with Oracle 7 and 8 and IBM Java 8.
+ */
+ @Test
+ public void testDefaultLayoutDefaultCharset() {
+ final ConsoleAppender appender = ConsoleAppender.newBuilder().build();
+ final PatternLayout layout = (PatternLayout) appender.getLayout();
+ final String charsetName = System.getProperty("sun.stdout.encoding");
+ final String expectedName = charsetName != null ? charsetName : Charset.defaultCharset().name();
+ Assert.assertEquals(expectedName, layout.getCharset().name());
+ }
+
+}
[39/50] [abbrv] logging-log4j2 git commit: [LOG4J2-1641] Update
JeroMQ from 0.3.5 to 0.3.6.
Posted by mi...@apache.org.
[LOG4J2-1641] Update JeroMQ from 0.3.5 to 0.3.6.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/8245e544
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/8245e544
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/8245e544
Branch: refs/heads/LOG4J2-1390
Commit: 8245e544be9e44b907dbfa7ebda7fa928d4c51a5
Parents: fc0e07c
Author: ggregory <gg...@US-L-GG02.rocketsoftware.com>
Authored: Mon Oct 10 14:12:39 2016 -0700
Committer: ggregory <gg...@US-L-GG02.rocketsoftware.com>
Committed: Mon Oct 10 14:12:39 2016 -0700
----------------------------------------------------------------------
pom.xml | 2 +-
src/changes/changes.xml | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8245e544/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a32f984..fd49ff7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -612,7 +612,7 @@
<dependency>
<groupId>org.zeromq</groupId>
<artifactId>jeromq</artifactId>
- <version>0.3.5</version>
+ <version>0.3.6</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8245e544/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 3288f97..d935048 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -30,6 +30,9 @@
<action issue="LOG4J2-1639" dev="ggregory" type="fix" due-to="Sridhar Gopinath">
Fix MemoryMappedFileAppender.createAppender() Javadoc for immediateFlush.
</action>
+ <action issue="LOG4J2-1641" dev="ggregory" type="update">
+ Update JeroMQ from 0.3.5 to 0.3.6.
+ </action>
</release>
<release version="2.7" date="2016-10-02" description="GA Release 2.7">
<action issue="LOG4J2-1618" dev="rpopma" type="fix" due-to="Raman Gupta">
[17/50] [abbrv] logging-log4j2 git commit: LOG4J2-1618 Fixed
ClassCastException when using JUL logging during shutdown.
Posted by mi...@apache.org.
LOG4J2-1618 Fixed ClassCastException when using JUL logging during shutdown.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a1cd9dd4
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a1cd9dd4
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a1cd9dd4
Branch: refs/heads/LOG4J2-1390
Commit: a1cd9dd42c4a12dc5bce723f0aff0e8eab332c6a
Parents: a36d111
Author: rpopma <rp...@apache.org>
Authored: Sat Oct 1 20:19:35 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sat Oct 1 20:19:35 2016 +0900
----------------------------------------------------------------------
.../java/org/apache/logging/log4j/jul/CoreLoggerAdapter.java | 7 +++++--
src/changes/changes.xml | 3 +++
2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a1cd9dd4/log4j-jul/src/main/java/org/apache/logging/log4j/jul/CoreLoggerAdapter.java
----------------------------------------------------------------------
diff --git a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/CoreLoggerAdapter.java b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/CoreLoggerAdapter.java
index bfdee1f..0840f7f 100644
--- a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/CoreLoggerAdapter.java
+++ b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/CoreLoggerAdapter.java
@@ -34,7 +34,10 @@ public class CoreLoggerAdapter extends AbstractLoggerAdapter {
@Override
protected Logger newLogger(final String name, final LoggerContext context) {
- return new CoreLogger((org.apache.logging.log4j.core.Logger) context.getLogger(name, MESSAGE_FACTORY));
+ final org.apache.logging.log4j.spi.ExtendedLogger original = context.getLogger(name, MESSAGE_FACTORY);
+ if (original instanceof org.apache.logging.log4j.core.Logger) {
+ return new CoreLogger((org.apache.logging.log4j.core.Logger) original);
+ }
+ return new ApiLogger(original); // LOG4J2-1618 during shutdown, a SimpleLogger may be returned
}
-
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a1cd9dd4/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 824b465..a304ac7 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -24,6 +24,9 @@
</properties>
<body>
<release version="2.7" date="2016-09-25" description="GA Release 2.7">
+ <action issue="LOG4J2-1618" dev="rpopma" type="fix" due-to="Raman Gupta">
+ Fixed ClassCastException when using JUL logging during shutdown.
+ </action>
<action issue="LOG4J2-1620" dev="ggregory" type="fix" due-to="Sascha Scholz">
2.7-rc1: RollingFileAppender immediateFlush default value should be true, not false.
</action>
[18/50] [abbrv] logging-log4j2 git commit: LOG4J2-1504 document
default value of on-demand RollingFileAppender attribute in Appenders manual
page
Posted by mi...@apache.org.
LOG4J2-1504 document default value of on-demand RollingFileAppender attribute in Appenders manual page
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d5269df3
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d5269df3
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d5269df3
Branch: refs/heads/LOG4J2-1390
Commit: d5269df3aea20489df4b48e66e31071e126a67dc
Parents: a1cd9dd
Author: rpopma <rp...@apache.org>
Authored: Sun Oct 2 15:24:45 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sun Oct 2 15:24:45 2016 +0900
----------------------------------------------------------------------
src/site/xdoc/manual/appenders.xml | 54 ++++++++++++++++-----------------
1 file changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d5269df3/src/site/xdoc/manual/appenders.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/manual/appenders.xml b/src/site/xdoc/manual/appenders.xml
index 30eb0dc..54c554c 100644
--- a/src/site/xdoc/manual/appenders.xml
+++ b/src/site/xdoc/manual/appenders.xml
@@ -429,7 +429,7 @@
<tr>
<td>createOnDemand</td>
<td>boolean</td>
- <td>The appender creates the file on-demand. The appender only creates the file when a log event
+ <td>The appender creates the file on-demand. The appender only creates the file when a log event
passes all filters and is routed to this appender. Defaults to false.</td>
</tr>
<tr>
@@ -1342,7 +1342,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
<a name="KafkaAppender"/>
<subsection name="KafkaAppender">
<p>
- The KafkaAppender logs events to an <a href="https://kafka.apache.org/">Apache Kafka</a> topic.
+ The KafkaAppender logs events to an <a href="https://kafka.apache.org/">Apache Kafka</a> topic.
Each log event is sent as a Kafka record with no key.
</p>
<table>
@@ -2210,8 +2210,8 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
<tr>
<td>createOnDemand</td>
<td>boolean</td>
- <td>The appender creates the file on-demand. The appender only creates the file when a log event
- passes all filters and is routed to this appender.</td>
+ <td>The appender creates the file on-demand. The appender only creates the file when a log event
+ passes all filters and is routed to this appender. Defaults to false.</td>
</tr>
<tr>
<td>filter</td>
@@ -3284,8 +3284,8 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
Appenders it references to allow it to shut down properly.
</p>
<p>
- You can also configure a RoutingAppender with scripts: you can run a script when the appender starts
- and when a route is chosen for an log event.
+ You can also configure a RoutingAppender with scripts: you can run a script when the appender starts
+ and when a route is chosen for an log event.
</p>
<table>
<caption align="top">RoutingAppender Parameters</caption>
@@ -3320,7 +3320,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
<td>Script</td>
<td>
<p>
- This Script runs when Log4j starts the RoutingAppender and returns a String Route key to
+ This Script runs when Log4j starts the RoutingAppender and returns a String Route key to
determine the default Route.
</p>
<p>
@@ -3343,7 +3343,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
<td>Map</td>
<td>
A Map shared between all script invocations for this appender instance. This is
- the same map passed to the Routes Script.
+ the same map passed to the Routes Script.
</td>
</tr>
</table>
@@ -3359,9 +3359,9 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
</tr>
</table>
<p>
- In this example, the script causes the "ServiceWindows" route to be the default route on Windows and
- "ServiceOther" on all other operating systems. Note that the List Appender is one of our test appenders,
- any appender can be used, it is only used as a shorthand.
+ In this example, the script causes the "ServiceWindows" route to be the default route on Windows and
+ "ServiceOther" on all other operating systems. Note that the List Appender is one of our test appenders,
+ any appender can be used, it is only used as a shorthand.
</p>
<pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" name="RoutingTest">
@@ -3428,7 +3428,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
<td>Map</td>
<td>
A Map shared between all script invocations for this appender instance. This is
- the same map passed to the Routes Script.
+ the same map passed to the Routes Script.
</td>
</tr>
<tr>
@@ -3438,7 +3438,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
</tr>
</table>
<p>
- In this example, the script runs for each log event and picks a route based on the presence of a
+ In this example, the script runs for each log event and picks a route based on the presence of a
Marker named "AUDIT".
</p>
<pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
@@ -3449,20 +3449,20 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
<Agent host="192.168.10.101" port="8800"/>
<Agent host="192.168.10.102" port="8800"/>
<RFC5424Layout enterpriseNumber="18060" includeMDC="true" appName="MyApp"/>
- </Flume>
+ </Flume>
<Routing name="Routing">
<Routes>
<Script name="RoutingInit" language="JavaScript"><![CDATA[
if (logEvent.getMarker() != null && logEvent.getMarker().isInstanceOf("AUDIT")) {
return "AUDIT";
- } else if (logEvent.getContextMap().containsKey("UserId")) {
+ } else if (logEvent.getContextMap().containsKey("UserId")) {
return logEvent.getContextMap().get("UserId");
}
return "STDOUT";]]]]><![CDATA[>
</Script>
<Route>
- <RollingFile
- name="Rolling-${mdc:UserId}"
+ <RollingFile
+ name="Rolling-${mdc:UserId}"
fileName="${mdc:UserId}.log"
filePattern="${mdc:UserId}.%i.log.gz">
<PatternLayout>
@@ -3474,7 +3474,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
<Route ref="AuditLogger" key="AUDIT"/>
<Route ref="STDOUT" key="STDOUT"/>
</Routes>
- <IdlePurgePolicy timeToLive="15" timeUnit="minutes"/>
+ <IdlePurgePolicy timeToLive="15" timeUnit="minutes"/>
</Routing>
</Appenders>
<Loggers>
@@ -3483,7 +3483,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
</Root>
</Loggers>
</Configuration>
-]]></pre>
+]]></pre>
<h4>Purge Policy</h4>
<p>The RoutingAppender can be configured with a PurgePolicy whose purpose is to stop and remove dormant
Appenders that have been dynamically created by the RoutingAppender. Log4j currently provides the
@@ -3660,15 +3660,15 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
<a name="ScriptAppenderSelector"/>
<subsection name="ScriptAppenderSelector">
<p>
- When the configuration is built, the <code>ScriptAppenderSelector</code> appender calls a <code>Script</code>
- to compute an appender name. Log4j then creates one of the appender named listed under
- <code>AppenderSet</code> using the name of the <code>ScriptAppenderSelector</code>. After configuration, Log4j
- ignores the <code>ScriptAppenderSelector</code>. Log4j only builds the one selected appender from the
- configuration tree, and ignores other <code>AppenderSet</code> child nodes.
+ When the configuration is built, the <code>ScriptAppenderSelector</code> appender calls a <code>Script</code>
+ to compute an appender name. Log4j then creates one of the appender named listed under
+ <code>AppenderSet</code> using the name of the <code>ScriptAppenderSelector</code>. After configuration, Log4j
+ ignores the <code>ScriptAppenderSelector</code>. Log4j only builds the one selected appender from the
+ configuration tree, and ignores other <code>AppenderSet</code> child nodes.
</p>
<p>
- In the following example, the script returns the name "List2". The appender name is recorded under
- the name of the <code>ScriptAppenderSelector</code>, not the name of the selected appender, in this example,
+ In the following example, the script returns the name "List2". The appender name is recorded under
+ the name of the <code>ScriptAppenderSelector</code>, not the name of the selected appender, in this example,
"SelectIt".
</p>
<pre class="prettyprint linenums"><![CDATA[<Configuration status="WARN" name="ScriptAppenderSelectorExample">
@@ -3689,7 +3689,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
<AppenderRef ref="SelectIt" />
</Root>
</Loggers>
-</Configuration>]]></pre>
+</Configuration>]]></pre>
</subsection>
<a name="SocketAppender"/>
<subsection name="SocketAppender">
[09/50] [abbrv] logging-log4j2 git commit: Stop the context to make
sure all files are compressed and closed. Trying to remedy failures in CI
builds.
Posted by mi...@apache.org.
Stop the context to make sure all files are compressed and closed.
Trying to remedy failures in CI builds.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/560120bc
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/560120bc
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/560120bc
Branch: refs/heads/LOG4J2-1390
Commit: 560120bc941d7bae6572a17980abbcd886364ba8
Parents: 60e47cb
Author: Gary Gregory <gg...@apache.org>
Authored: Wed Sep 28 21:59:53 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Sep 28 21:59:53 2016 -0700
----------------------------------------------------------------------
.../log4j/core/appender/rolling/RollingAppenderSizeTest.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/560120bc/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
index 4b28d20..addc42d 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
@@ -34,6 +34,7 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collection;
+import java.util.concurrent.TimeUnit;
import org.apache.commons.compress.compressors.CompressorException;
import org.apache.commons.compress.compressors.CompressorInputStream;
@@ -138,6 +139,8 @@ public class RollingAppenderSizeTest {
|| DefaultRolloverStrategy.FileExtensions.PACK200 == ext) {
return; // Apache Commons Compress cannot deflate zip? TODO test decompressing these formats
}
+ // Stop the context to make sure all files are compressed and closed. Trying to remedy failures in CI builds.
+ loggerContextRule.getLoggerContext().stop(30, TimeUnit.SECONDS);
for (final File file : files) {
if (file.getName().endsWith(fileExtension)) {
CompressorInputStream in = null;
[10/50] [abbrv] logging-log4j2 git commit: Stop the context to make
sure all files are compressed and closed. Trying to remedy failures in CI
builds.
Posted by mi...@apache.org.
Stop the context to make sure all files are compressed and closed.
Trying to remedy failures in CI builds.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/166d3fab
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/166d3fab
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/166d3fab
Branch: refs/heads/LOG4J2-1390
Commit: 166d3fab4376125aa30e7b0c63d64eef99a02eb9
Parents: 560120b
Author: Gary Gregory <gg...@apache.org>
Authored: Wed Sep 28 22:00:57 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Sep 28 22:00:57 2016 -0700
----------------------------------------------------------------------
.../log4j/core/appender/rolling/RollingAppenderSizeTest.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/166d3fab/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
index addc42d..cb3bc98 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderSizeTest.java
@@ -140,7 +140,9 @@ public class RollingAppenderSizeTest {
return; // Apache Commons Compress cannot deflate zip? TODO test decompressing these formats
}
// Stop the context to make sure all files are compressed and closed. Trying to remedy failures in CI builds.
- loggerContextRule.getLoggerContext().stop(30, TimeUnit.SECONDS);
+ if (loggerContextRule.getLoggerContext().stop(30, TimeUnit.SECONDS)) {
+ System.err.println("Could not stop cleanly " + loggerContextRule + " for " + this);
+ }
for (final File file : files) {
if (file.getName().endsWith(fileExtension)) {
CompressorInputStream in = null;
[02/50] [abbrv] logging-log4j2 git commit: Remove unneeded ()'s.
Posted by mi...@apache.org.
Remove unneeded ()'s.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/10a34436
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/10a34436
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/10a34436
Branch: refs/heads/LOG4J2-1390
Commit: 10a34436f4c455d08078e0e52392f92eb90c0b9b
Parents: 5aa0313
Author: Gary Gregory <gg...@apache.org>
Authored: Wed Sep 28 14:45:49 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Sep 28 14:45:49 2016 -0700
----------------------------------------------------------------------
.../apache/logging/log4j/core/appender/SyslogAppenderTestBase.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/10a34436/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTestBase.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTestBase.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTestBase.java
index c1e1023..11a8275 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTestBase.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SyslogAppenderTestBase.java
@@ -49,7 +49,7 @@ public class SyslogAppenderTestBase {
@BeforeClass
public static void setupClass() throws Exception {
- (LoggerContext.getContext()).reconfigure();
+ LoggerContext.getContext().reconfigure();
}
protected void sendAndCheckLegacyBSDMessages(final List<String> messagesToSend) throws InterruptedException {
[15/50] [abbrv] logging-log4j2 git commit: [LOG4J2-1620] .7-rc1:
RollingFileAppender immediateFlush default value should be true,
not false. Add tests.
Posted by mi...@apache.org.
[LOG4J2-1620] .7-rc1: RollingFileAppender immediateFlush default value
should be true, not false. Add tests.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6bedc20e
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6bedc20e
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6bedc20e
Branch: refs/heads/LOG4J2-1390
Commit: 6bedc20e375a54b7887ebff5b799f0612c314bf2
Parents: 003cada
Author: Gary Gregory <gg...@apache.org>
Authored: Thu Sep 29 12:17:21 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu Sep 29 12:17:21 2016 -0700
----------------------------------------------------------------------
.../appender/ConsoleAppenderBuilderTest.java | 31 +++++++++++++++++++
.../core/appender/FileAppenderBuilderTest.java | 31 +++++++++++++++++++
.../appender/SocketAppenderBuilderTest.java | 32 ++++++++++++++++++++
.../rolling/RollingFileAppenderBuilderTest.java | 32 ++++++++++++++++++++
4 files changed, 126 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6bedc20e/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java
new file mode 100644
index 0000000..2531a31
--- /dev/null
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderBuilderTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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 org.junit.Assert;
+import org.junit.Test;
+
+public class ConsoleAppenderBuilderTest {
+
+ /**
+ * Tests https://issues.apache.org/jira/browse/LOG4J2-1620
+ */
+ @Test
+ public void testDefaultImmediateFlush() {
+ Assert.assertTrue(ConsoleAppender.newBuilder().isImmediateFlush());
+ }
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6bedc20e/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderBuilderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderBuilderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderBuilderTest.java
new file mode 100644
index 0000000..8305a07
--- /dev/null
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderBuilderTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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 org.junit.Assert;
+import org.junit.Test;
+
+public class FileAppenderBuilderTest {
+
+ /**
+ * Tests https://issues.apache.org/jira/browse/LOG4J2-1620
+ */
+ @Test
+ public void testDefaultImmediateFlush() {
+ Assert.assertTrue(FileAppender.newBuilder().isImmediateFlush());
+ }
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6bedc20e/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderBuilderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderBuilderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderBuilderTest.java
new file mode 100644
index 0000000..bdfd35a
--- /dev/null
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/SocketAppenderBuilderTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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 org.apache.logging.log4j.core.appender.SocketAppender;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class SocketAppenderBuilderTest {
+
+ /**
+ * Tests https://issues.apache.org/jira/browse/LOG4J2-1620
+ */
+ @Test
+ public void testDefaultImmediateFlush() {
+ Assert.assertTrue(SocketAppender.newBuilder().isImmediateFlush());
+ }
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6bedc20e/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderBuilderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderBuilderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderBuilderTest.java
new file mode 100644
index 0000000..4bf0dca
--- /dev/null
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderBuilderTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.junit.Assert;
+import org.junit.Test;
+
+public class RollingFileAppenderBuilderTest {
+
+ /**
+ * Tests https://issues.apache.org/jira/browse/LOG4J2-1620
+ */
+ @Test
+ public void testDefaultImmediateFlush() {
+ Assert.assertTrue(RollingFileAppender.newBuilder().isImmediateFlush());
+ }
+}
[05/50] [abbrv] logging-log4j2 git commit: [LOG4J2-1506] Unregister
JMX ignores log4j2.disable.jmx property. For JMX and GAE,
catch (LinkageError and Exception) instead of Throwable.
Posted by mi...@apache.org.
[LOG4J2-1506] Unregister JMX ignores log4j2.disable.jmx property. For
JMX and GAE, catch (LinkageError and Exception) instead of Throwable.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/baea9914
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/baea9914
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/baea9914
Branch: refs/heads/LOG4J2-1390
Commit: baea9914fa5aa32706e62bb52109df5837a9bcbd
Parents: 83cd00e
Author: Gary Gregory <gg...@apache.org>
Authored: Wed Sep 28 16:41:12 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Sep 28 16:41:12 2016 -0700
----------------------------------------------------------------------
.../java/org/apache/logging/log4j/core/LoggerContext.java | 9 +++++----
.../org/apache/logging/log4j/core/lookup/Interpolator.java | 8 ++++----
.../org/apache/logging/log4j/core/util/ReflectionUtil.java | 2 +-
3 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/baea9914/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
index 104a921..7e13963 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
@@ -315,8 +315,9 @@ public class LoggerContext extends AbstractLifeCycle
this.setStopping();
try {
Server.unregisterLoggerContext(getName()); // LOG4J2-406, LOG4J2-500
- } catch (final Throwable t) {
- LOGGER.error("Unable to unregister MBeans", t);
+ } catch (final LinkageError | Exception e) {
+ // LOG4J2-1506 Hello Android, GAE
+ LOGGER.error("Unable to unregister MBeans", e);
}
if (shutdownCallback != null) {
shutdownCallback.cancel();
@@ -538,9 +539,9 @@ public class LoggerContext extends AbstractLifeCycle
try {
Server.reregisterMBeansAfterReconfigure();
- } catch (final Throwable t) {
+ } catch (final LinkageError | Exception e) {
// LOG4J2-716: Android has no java.lang.management
- LOGGER.error("Could not reconfigure JMX", t);
+ LOGGER.error("Could not reconfigure JMX", e);
}
// AsyncLoggers update their nanoClock when the configuration changes
Log4jLogEvent.setNanoClock(configuration.getNanoClock());
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/baea9914/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
index b480fa0..ba50ca7 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
@@ -100,8 +100,8 @@ public class Interpolator extends AbstractConfigurationAwareLookup {
// [LOG4J2-703] We might be on Android
lookups.put(LOOKUP_KEY_JNDI,
Loader.newCheckedInstanceOf("org.apache.logging.log4j.core.lookup.JndiLookup", StrLookup.class));
- } catch (final Throwable t) {
- handleError(LOOKUP_KEY_JNDI, t);
+ } catch (final LinkageError | Exception e) {
+ handleError(LOOKUP_KEY_JNDI, e);
}
// JMX input args
try {
@@ -109,8 +109,8 @@ public class Interpolator extends AbstractConfigurationAwareLookup {
lookups.put(LOOKUP_KEY_JVMRUNARGS,
Loader.newCheckedInstanceOf("org.apache.logging.log4j.core.lookup.JmxRuntimeInputArgumentsLookup",
StrLookup.class));
- } catch (final Throwable t) {
- handleError(LOOKUP_KEY_JVMRUNARGS, t);
+ } catch (final LinkageError | Exception e) {
+ handleError(LOOKUP_KEY_JVMRUNARGS, e);
}
lookups.put("date", new DateLookup());
lookups.put("ctx", new ContextMapLookup());
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/baea9914/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ReflectionUtil.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ReflectionUtil.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ReflectionUtil.java
index 86f6c87..ffee439 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ReflectionUtil.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ReflectionUtil.java
@@ -186,7 +186,7 @@ public final class ReflectionUtil {
final Constructor<T> constructor = getDefaultConstructor(clazz);
try {
return constructor.newInstance();
- } catch (final NoClassDefFoundError | InstantiationException e) {
+ } catch (final LinkageError | InstantiationException e) {
// LOG4J2-1051
// On platforms like Google App Engine and Android, some JRE classes are not supported: JMX, JNDI, etc.
throw new IllegalArgumentException(e);
[13/50] [abbrv] logging-log4j2 git commit: [LOG4J2-1620] .7-rc1:
RollingFileAppender immediateFlush default value should be true, not false.
Posted by mi...@apache.org.
[LOG4J2-1620] .7-rc1: RollingFileAppender immediateFlush default value
should be true, not false.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d7d1cf7d
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d7d1cf7d
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d7d1cf7d
Branch: refs/heads/LOG4J2-1390
Commit: d7d1cf7d488ef73f01884ab30122c5bf7cd98393
Parents: 81eeff1
Author: Gary Gregory <gg...@apache.org>
Authored: Thu Sep 29 12:00:11 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu Sep 29 12:00:11 2016 -0700
----------------------------------------------------------------------
.../appender/AbstractOutputStreamAppender.java | 376 +++++++++----------
src/changes/changes.xml | 3 +
2 files changed, 191 insertions(+), 188 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d7d1cf7d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java
index f7e86b4..b186aea 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractOutputStreamAppender.java
@@ -1,188 +1,188 @@
-/*
- * 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.concurrent.TimeUnit;
-
-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.config.plugins.PluginBuilderAttribute;
-import org.apache.logging.log4j.core.util.Constants;
-
-/**
- * Appends log events as bytes to a byte output stream. The stream encoding is defined in the layout.
- *
- * @param <M> The kind of {@link OutputStreamManager} under management
- */
-public abstract class AbstractOutputStreamAppender<M extends OutputStreamManager> extends AbstractAppender {
-
- /**
- * Subclasses can extend this abstract Builder.
- *
- * @param <B> This builder class.
- */
- public abstract static class Builder<B extends Builder<B>> extends AbstractAppender.Builder<B> {
-
- @PluginBuilderAttribute
- private boolean bufferedIo = true;
-
- @PluginBuilderAttribute
- private int bufferSize = Constants.ENCODER_BYTE_BUFFER_SIZE;
-
- @PluginBuilderAttribute
- private boolean immediateFlush;
-
- public int getBufferSize() {
- return bufferSize;
- }
-
- public boolean isBufferedIo() {
- return bufferedIo;
- }
-
- public boolean isImmediateFlush() {
- return immediateFlush;
- }
-
- public B withImmediateFlush(final boolean immediateFlush) {
- this.immediateFlush = immediateFlush;
- return asBuilder();
- }
-
- public B withBufferedIo(final boolean bufferedIo) {
- this.bufferedIo = bufferedIo;
- return asBuilder();
- }
-
- public B withBufferSize(final int bufferSize) {
- this.bufferSize = bufferSize;
- return asBuilder();
- }
-
- }
-
- /**
- * Immediate flush means that the underlying writer or output stream will be flushed at the end of each append
- * operation. Immediate flush is slower but ensures that each append request is actually written. If
- * <code>immediateFlush</code> is set to {@code false}, then there is a good chance that the last few logs events
- * are not actually written to persistent media if and when the application crashes.
- */
- private final boolean immediateFlush;
-
- private final M manager;
-
- /**
- * Instantiates a WriterAppender and set the output destination to a new {@link java.io.OutputStreamWriter}
- * initialized with <code>os</code> as its {@link java.io.OutputStream}.
- *
- * @param name The name of the Appender.
- * @param layout The layout to format the message.
- * @param manager The OutputStreamManager.
- */
- protected AbstractOutputStreamAppender(final String name, final Layout<? extends Serializable> layout,
- final Filter filter, final boolean ignoreExceptions, final boolean immediateFlush, final M manager) {
- super(name, filter, layout, ignoreExceptions);
- this.manager = manager;
- this.immediateFlush = immediateFlush;
- }
-
- /**
- * Gets the immediate flush setting.
- *
- * @return immediate flush.
- */
- public boolean getImmediateFlush() {
- return immediateFlush;
- }
-
- /**
- * Gets the manager.
- *
- * @return the manager.
- */
- public M getManager() {
- return manager;
- }
-
- @Override
- public void start() {
- if (getLayout() == null) {
- LOGGER.error("No layout set for the appender named [" + getName() + "].");
- }
- if (manager == null) {
- LOGGER.error("No OutputStreamManager set for the appender named [" + getName() + "].");
- }
- super.start();
- }
-
- @Override
- public boolean stop(final long timeout, final TimeUnit timeUnit) {
- return stop(timeout, timeUnit, true);
- }
-
- @Override
- protected boolean stop(final long timeout, final TimeUnit timeUnit, final boolean changeLifeCycleState) {
- boolean stopped = super.stop(timeout, timeUnit, changeLifeCycleState);
- stopped &= manager.stop(timeout, timeUnit);
- if (changeLifeCycleState) {
- setStopped();
- }
- return stopped;
- }
-
- /**
- * Actual writing occurs here.
- * <p>
- * Most subclasses of <code>AbstractOutputStreamAppender</code> will need to override this method.
- * </p>
- *
- * @param event The LogEvent.
- */
- @Override
- public void append(final LogEvent event) {
- try {
- tryAppend(event);
- } catch (final AppenderLoggingException ex) {
- error("Unable to write to stream " + manager.getName() + " for appender " + getName() + ": " + ex);
- throw ex;
- }
- }
-
- private void tryAppend(final LogEvent event) {
- if (Constants.ENABLE_DIRECT_ENCODERS) {
- directEncodeEvent(event);
- } else {
- writeByteArrayToManager(event);
- }
- }
-
- protected void directEncodeEvent(final LogEvent event) {
- getLayout().encode(event, manager);
- if (this.immediateFlush || event.isEndOfBatch()) {
- manager.flush();
- }
- }
-
- protected void writeByteArrayToManager(final LogEvent event) {
- final byte[] bytes = getLayout().toByteArray(event);
- if (bytes != null && bytes.length > 0) {
- manager.write(bytes, this.immediateFlush || event.isEndOfBatch());
- }
- }
-}
+/*
+ * 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.concurrent.TimeUnit;
+
+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.config.plugins.PluginBuilderAttribute;
+import org.apache.logging.log4j.core.util.Constants;
+
+/**
+ * Appends log events as bytes to a byte output stream. The stream encoding is defined in the layout.
+ *
+ * @param <M> The kind of {@link OutputStreamManager} under management
+ */
+public abstract class AbstractOutputStreamAppender<M extends OutputStreamManager> extends AbstractAppender {
+
+ /**
+ * Subclasses can extend this abstract Builder.
+ *
+ * @param <B> This builder class.
+ */
+ public abstract static class Builder<B extends Builder<B>> extends AbstractAppender.Builder<B> {
+
+ @PluginBuilderAttribute
+ private boolean bufferedIo = true;
+
+ @PluginBuilderAttribute
+ private int bufferSize = Constants.ENCODER_BYTE_BUFFER_SIZE;
+
+ @PluginBuilderAttribute
+ private boolean immediateFlush = true;
+
+ public int getBufferSize() {
+ return bufferSize;
+ }
+
+ public boolean isBufferedIo() {
+ return bufferedIo;
+ }
+
+ public boolean isImmediateFlush() {
+ return immediateFlush;
+ }
+
+ public B withImmediateFlush(final boolean immediateFlush) {
+ this.immediateFlush = immediateFlush;
+ return asBuilder();
+ }
+
+ public B withBufferedIo(final boolean bufferedIo) {
+ this.bufferedIo = bufferedIo;
+ return asBuilder();
+ }
+
+ public B withBufferSize(final int bufferSize) {
+ this.bufferSize = bufferSize;
+ return asBuilder();
+ }
+
+ }
+
+ /**
+ * Immediate flush means that the underlying writer or output stream will be flushed at the end of each append
+ * operation. Immediate flush is slower but ensures that each append request is actually written. If
+ * <code>immediateFlush</code> is set to {@code false}, then there is a good chance that the last few logs events
+ * are not actually written to persistent media if and when the application crashes.
+ */
+ private final boolean immediateFlush;
+
+ private final M manager;
+
+ /**
+ * Instantiates a WriterAppender and set the output destination to a new {@link java.io.OutputStreamWriter}
+ * initialized with <code>os</code> as its {@link java.io.OutputStream}.
+ *
+ * @param name The name of the Appender.
+ * @param layout The layout to format the message.
+ * @param manager The OutputStreamManager.
+ */
+ protected AbstractOutputStreamAppender(final String name, final Layout<? extends Serializable> layout,
+ final Filter filter, final boolean ignoreExceptions, final boolean immediateFlush, final M manager) {
+ super(name, filter, layout, ignoreExceptions);
+ this.manager = manager;
+ this.immediateFlush = immediateFlush;
+ }
+
+ /**
+ * Gets the immediate flush setting.
+ *
+ * @return immediate flush.
+ */
+ public boolean getImmediateFlush() {
+ return immediateFlush;
+ }
+
+ /**
+ * Gets the manager.
+ *
+ * @return the manager.
+ */
+ public M getManager() {
+ return manager;
+ }
+
+ @Override
+ public void start() {
+ if (getLayout() == null) {
+ LOGGER.error("No layout set for the appender named [" + getName() + "].");
+ }
+ if (manager == null) {
+ LOGGER.error("No OutputStreamManager set for the appender named [" + getName() + "].");
+ }
+ super.start();
+ }
+
+ @Override
+ public boolean stop(final long timeout, final TimeUnit timeUnit) {
+ return stop(timeout, timeUnit, true);
+ }
+
+ @Override
+ protected boolean stop(final long timeout, final TimeUnit timeUnit, final boolean changeLifeCycleState) {
+ boolean stopped = super.stop(timeout, timeUnit, changeLifeCycleState);
+ stopped &= manager.stop(timeout, timeUnit);
+ if (changeLifeCycleState) {
+ setStopped();
+ }
+ return stopped;
+ }
+
+ /**
+ * Actual writing occurs here.
+ * <p>
+ * Most subclasses of <code>AbstractOutputStreamAppender</code> will need to override this method.
+ * </p>
+ *
+ * @param event The LogEvent.
+ */
+ @Override
+ public void append(final LogEvent event) {
+ try {
+ tryAppend(event);
+ } catch (final AppenderLoggingException ex) {
+ error("Unable to write to stream " + manager.getName() + " for appender " + getName() + ": " + ex);
+ throw ex;
+ }
+ }
+
+ private void tryAppend(final LogEvent event) {
+ if (Constants.ENABLE_DIRECT_ENCODERS) {
+ directEncodeEvent(event);
+ } else {
+ writeByteArrayToManager(event);
+ }
+ }
+
+ protected void directEncodeEvent(final LogEvent event) {
+ getLayout().encode(event, manager);
+ if (this.immediateFlush || event.isEndOfBatch()) {
+ manager.flush();
+ }
+ }
+
+ protected void writeByteArrayToManager(final LogEvent event) {
+ final byte[] bytes = getLayout().toByteArray(event);
+ if (bytes != null && bytes.length > 0) {
+ manager.write(bytes, this.immediateFlush || event.isEndOfBatch());
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d7d1cf7d/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 6c5d2cd..824b465 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -24,6 +24,9 @@
</properties>
<body>
<release version="2.7" date="2016-09-25" description="GA Release 2.7">
+ <action issue="LOG4J2-1620" dev="ggregory" type="fix" due-to="Sascha Scholz">
+ 2.7-rc1: RollingFileAppender immediateFlush default value should be true, not false.
+ </action>
<action issue="LOG4J2-1611" dev="rpopma" type="fix">
Improved performance of context data injector for web applications to be on par with standalone applications.
</action>
[35/50] [abbrv] logging-log4j2 git commit: Javadoc: Use the active
voice.
Posted by mi...@apache.org.
Javadoc: Use the active voice.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/eed7c071
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/eed7c071
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/eed7c071
Branch: refs/heads/LOG4J2-1390
Commit: eed7c07182384a7530268891d2b26a0368181eaa
Parents: 118abf4
Author: Gary Gregory <gg...@apache.org>
Authored: Fri Oct 7 15:15:43 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Fri Oct 7 15:15:43 2016 -0700
----------------------------------------------------------------------
.../java/org/apache/logging/log4j/core/layout/HtmlLayout.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/eed7c071/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java
index 2acf335..6cd64d3 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java
@@ -132,7 +132,7 @@ public final class HtmlLayout extends AbstractStringLayout {
}
/**
- * Format as a String.
+ * Formats as a String.
*
* @param event The Logging Event.
* @return A String containing the LogEvent as HTML.
@@ -325,7 +325,7 @@ public final class HtmlLayout extends AbstractStringLayout {
}
/**
- * Create an HTML Layout.
+ * Creates an HTML Layout.
* @param locationInfo If "true", location information will be included. The default is false.
* @param title The title to include in the file header. If none is specified the default title will be used.
* @param contentType The content type. Defaults to "text/html".
[16/50] [abbrv] logging-log4j2 git commit: [LOG4J2-1501] FileAppender
should be able to create files on-demand. Document default in site docs.
Posted by mi...@apache.org.
[LOG4J2-1501] FileAppender should be able to create files on-demand.
Document default in site docs.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a36d1110
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a36d1110
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a36d1110
Branch: refs/heads/LOG4J2-1390
Commit: a36d1110a10f401120372a9a92df3dd9bd74f9f2
Parents: 6bedc20
Author: Gary Gregory <gg...@apache.org>
Authored: Fri Sep 30 16:16:37 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Fri Sep 30 16:16:37 2016 -0700
----------------------------------------------------------------------
src/site/xdoc/manual/appenders.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a36d1110/src/site/xdoc/manual/appenders.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/manual/appenders.xml b/src/site/xdoc/manual/appenders.xml
index 7c114c9..30eb0dc 100644
--- a/src/site/xdoc/manual/appenders.xml
+++ b/src/site/xdoc/manual/appenders.xml
@@ -430,7 +430,7 @@
<td>createOnDemand</td>
<td>boolean</td>
<td>The appender creates the file on-demand. The appender only creates the file when a log event
- passes all filters and is routed to this appender.</td>
+ passes all filters and is routed to this appender. Defaults to false.</td>
</tr>
<tr>
<td>filter</td>
[48/50] [abbrv] logging-log4j2 git commit: Migrate unit tests to
Mockito 2.x
Posted by mi...@apache.org.
Migrate unit tests to Mockito 2.x
This commit completely migrates from EasyMock to Mockito 2.x. Unit tests
have been updated to use the BDD-style of Mockito's API
(given/when/then). Various test cleanups were also included during the
migration.
Related to LOG4J2-1646.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/78c6a1fc
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/78c6a1fc
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/78c6a1fc
Branch: refs/heads/LOG4J2-1390
Commit: 78c6a1fcae718f5edd177256ab157f555b84f37a
Parents: f3e9ea1
Author: Matt Sicker <bo...@gmail.com>
Authored: Sun Oct 23 15:09:35 2016 -0500
Committer: Matt Sicker <bo...@gmail.com>
Committed: Sun Oct 23 15:12:03 2016 -0500
----------------------------------------------------------------------
log4j-core/pom.xml | 4 +-
.../core/appender/ConsoleAppenderTest.java | 27 +-
.../db/AbstractDatabaseAppenderTest.java | 145 +++----
.../db/AbstractDatabaseManagerTest.java | 356 +++++++--------
.../db/jdbc/AbstractJdbcAppenderTest.java | 20 +-
.../db/jdbc/DataSourceConnectionSourceTest.java | 17 +-
.../jdbc/FactoryMethodConnectionSourceTest.java | 53 +--
.../log4j/core/lookup/Log4jLookupTest.java | 33 +-
.../core/lookup/Log4jLookupWithSpacesTest.java | 35 +-
log4j-iostreams/pom.xml | 4 +-
.../io/AbstractLoggerOutputStreamTest.java | 15 +-
.../log4j/io/AbstractLoggerWriterTest.java | 15 +-
log4j-nosql/pom.xml | 5 +-
.../log4j/nosql/appender/NoSqlAppenderTest.java | 30 +-
.../appender/NoSqlDatabaseManagerTest.java | 434 ++++++-------------
log4j-web/pom.xml | 4 +-
.../Log4jServletContainerInitializerTest.java | 164 +++----
.../web/Log4jServletContextListenerTest.java | 58 +--
.../log4j/web/Log4jServletFilterTest.java | 114 ++---
.../log4j/web/Log4jWebInitializerImplTest.java | 367 ++++------------
pom.xml | 7 +-
src/changes/changes.xml | 3 +
22 files changed, 658 insertions(+), 1252 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-core/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml
index 2fbc78c..5cda105 100644
--- a/log4j-core/pom.xml
+++ b/log4j-core/pom.xml
@@ -203,8 +203,8 @@
</dependency>
<!-- Mocking framework for use with JUnit -->
<dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<!-- Embedded JDBC drivers for database appender tests -->
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderTest.java
index 87aef83..c53eb43 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/ConsoleAppenderTest.java
@@ -27,22 +27,25 @@ import org.apache.logging.log4j.core.impl.Log4jLogEvent;
import org.apache.logging.log4j.core.layout.PatternLayout;
import org.apache.logging.log4j.message.SimpleMessage;
import org.apache.logging.log4j.util.Strings;
-import org.easymock.EasyMockSupport;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
-import static org.easymock.EasyMock.anyInt;
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.expectLastCall;
import static org.junit.Assert.*;
-
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.BDDMockito.then;
+import static org.mockito.Mockito.atLeastOnce;
/**
*
*/
+@RunWith(MockitoJUnitRunner.class)
public class ConsoleAppenderTest {
private static final String LOG4J_SKIP_JANSI = "log4j.skipJansi";
@@ -59,15 +62,12 @@ public class ConsoleAppenderTest {
ByteArrayOutputStream baos;
- EasyMockSupport mocks;
-
+ @Mock
PrintStream psMock;
@Before
public void before() {
System.setProperty(LOG4J_SKIP_JANSI, "true");
- mocks = new EasyMockSupport();
- psMock = mocks.createMock("psMock", PrintStream.class);
baos = new ByteArrayOutputStream();
}
@@ -90,12 +90,6 @@ public class ConsoleAppenderTest {
private void testConsoleStreamManagerDoesNotClose(final PrintStream ps, final Target targetName, final SystemSetter systemSetter) {
try {
- psMock.write((byte[]) anyObject(), anyInt(), anyInt());
- expectLastCall().anyTimes();
- psMock.flush();
- expectLastCall().anyTimes();
-
- mocks.replayAll();
systemSetter.systemSet(psMock);
final Layout<String> layout = PatternLayout.newBuilder().withAlwaysWriteExceptions(true).build();
final ConsoleAppender app = ConsoleAppender.newBuilder().withLayout(layout).setTarget(targetName)
@@ -116,7 +110,8 @@ public class ConsoleAppenderTest {
} finally {
systemSetter.systemSet(ps);
}
- mocks.verifyAll();
+ then(psMock).should(atLeastOnce()).write(any(byte[].class), anyInt(), anyInt());
+ then(psMock).should(atLeastOnce()).flush();
}
@Test
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppenderTest.java
index 276930c..cf33cea 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseAppenderTest.java
@@ -16,138 +16,94 @@
*/
package org.apache.logging.log4j.core.appender.db;
+import java.util.concurrent.TimeUnit;
+
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.LogEvent;
-import org.junit.After;
import org.junit.Test;
-
-import static org.easymock.EasyMock.*;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
import static org.junit.Assert.*;
+import static org.mockito.ArgumentMatchers.same;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.BDDMockito.then;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.reset;
+@RunWith(MockitoJUnitRunner.class)
public class AbstractDatabaseAppenderTest {
private LocalAbstractDatabaseAppender appender;
+ @Mock
private LocalAbstractDatabaseManager manager;
public void setUp(final String name) {
- this.manager = createMockBuilder(LocalAbstractDatabaseManager.class)
- .withConstructor(String.class, int.class)
- .withArgs(name, 0)
- .addMockedMethod("close")
- .createStrictMock();
-
- this.appender = createMockBuilder(LocalAbstractDatabaseAppender.class)
- .withConstructor(String.class, Filter.class, boolean.class, LocalAbstractDatabaseManager.class)
- .withArgs(name, null, true, this.manager)
- .createStrictMock();
- }
-
- @After
- public void tearDown() {
- verify(this.manager, this.appender);
+ appender = new LocalAbstractDatabaseAppender(name, null, true, manager);
}
@Test
public void testNameAndGetLayout01() {
- this.setUp("testName01");
+ setUp("testName01");
- replay(this.manager, this.appender);
-
- assertEquals("The name is not correct.", "testName01", this.appender.getName());
- assertNull("The layout should always be null.", this.appender.getLayout());
+ assertEquals("The name is not correct.", "testName01", appender.getName());
+ assertNull("The layout should always be null.", appender.getLayout());
}
@Test
public void testNameAndGetLayout02() {
- this.setUp("anotherName02");
-
- replay(this.manager, this.appender);
+ setUp("anotherName02");
- assertEquals("The name is not correct.", "anotherName02", this.appender.getName());
- assertNull("The layout should always be null.", this.appender.getLayout());
+ assertEquals("The name is not correct.", "anotherName02", appender.getName());
+ assertNull("The layout should always be null.", appender.getLayout());
}
@Test
public void testStartAndStop() throws Exception {
- this.setUp("name");
-
- this.manager.startupInternal();
- expectLastCall();
- replay(this.manager, this.appender);
-
- this.appender.start();
+ setUp("name");
- verify(this.manager, this.appender);
- reset(this.manager, this.appender);
- this.manager.shutdownInternal();
- expectLastCall().andReturn(Boolean.TRUE);
- replay(this.manager, this.appender);
+ appender.start();
+ then(manager).should().startupInternal();
- this.appender.stop();
+ appender.stop();
+ then(manager).should().stop(0L, TimeUnit.MILLISECONDS);
}
@Test
public void testReplaceManager() throws Exception {
- this.setUp("name");
+ setUp("name");
- replay(this.manager, this.appender);
+ final LocalAbstractDatabaseManager oldManager = appender.getManager();
+ assertSame("The manager should be the same.", manager, oldManager);
- final LocalAbstractDatabaseManager manager = this.appender.getManager();
+ final LocalAbstractDatabaseManager newManager = mock(LocalAbstractDatabaseManager.class);
+ appender.replaceManager(newManager);
+ then(manager).should().close();
+ then(newManager).should().startupInternal();
- assertSame("The manager should be the same.", this.manager, manager);
+ appender.stop();
+ then(newManager).should().stop(0L, TimeUnit.MILLISECONDS);
+ }
- verify(this.manager, this.appender);
- reset(this.manager, this.appender);
- this.manager.close();
- expectLastCall();
- final LocalAbstractDatabaseManager newManager = createMockBuilder(LocalAbstractDatabaseManager.class)
- .withConstructor(String.class, int.class).withArgs("name", 0).addMockedMethod("close")
- .createStrictMock();
- newManager.startupInternal();
- expectLastCall();
- replay(this.manager, this.appender, newManager);
+ @Test
+ public void testAppend() {
+ setUp("name");
+ given(manager.commitAndClose()).willReturn(true);
- this.appender.replaceManager(newManager);
+ final LogEvent event1 = mock(LogEvent.class);
+ final LogEvent event2 = mock(LogEvent.class);
- verify(this.manager, this.appender, newManager);
- reset(this.manager, this.appender, newManager);
- newManager.shutdownInternal();
- expectLastCall().andReturn(Boolean.TRUE);
- replay(this.manager, this.appender, newManager);
+ appender.append(event1);
+ then(manager).should().connectAndStart();
+ then(manager).should().writeInternal(same(event1));
+ then(manager).should().commitAndClose();
- this.appender.stop();
+ reset(manager);
- verify(newManager);
- }
-
- @Test
- public void testAppend() {
- this.setUp("name");
-
- final LogEvent event1 = createStrictMock(LogEvent.class);
- final LogEvent event2 = createStrictMock(LogEvent.class);
-
- this.manager.connectAndStart();
- expectLastCall();
- this.manager.writeInternal(same(event1));
- expectLastCall();
- this.manager.commitAndClose();
- expectLastCall().andReturn(Boolean.TRUE);
- replay(this.manager, this.appender);
-
- this.appender.append(event1);
-
- verify(this.manager, this.appender);
- reset(this.manager, this.appender);
- this.manager.connectAndStart();
- expectLastCall();
- this.manager.writeInternal(same(event2));
- expectLastCall();
- this.manager.commitAndClose();
- expectLastCall().andReturn(Boolean.TRUE);
- replay(this.manager, this.appender);
-
- this.appender.append(event2);
+ appender.append(event2);
+ then(manager).should().connectAndStart();
+ then(manager).should().writeInternal(same(event2));
+ then(manager).should().commitAndClose();
}
private static abstract class LocalAbstractDatabaseManager extends AbstractDatabaseManager {
@@ -156,8 +112,7 @@ public class AbstractDatabaseAppenderTest {
}
}
- private static abstract class LocalAbstractDatabaseAppender extends
- AbstractDatabaseAppender<LocalAbstractDatabaseManager> {
+ private static class LocalAbstractDatabaseAppender extends AbstractDatabaseAppender<LocalAbstractDatabaseManager> {
public LocalAbstractDatabaseAppender(final String name, final Filter filter, final boolean exceptionSuppressed,
final LocalAbstractDatabaseManager manager) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java
index 3a8ae8f..04d7699 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/AbstractDatabaseManagerTest.java
@@ -17,261 +17,201 @@
package org.apache.logging.log4j.core.appender.db;
import org.apache.logging.log4j.core.LogEvent;
-import org.junit.After;
import org.junit.Test;
-import static org.easymock.EasyMock.*;
-
import static org.junit.Assert.*;
+import static org.mockito.ArgumentMatchers.same;
+import static org.mockito.BDDMockito.then;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.spy;
public class AbstractDatabaseManagerTest {
private AbstractDatabaseManager manager;
public void setUp(final String name, final int buffer) {
- this.manager = createMockBuilder(AbstractDatabaseManager.class)
- .withConstructor(String.class, int.class)
- .withArgs(name, buffer)
- .addMockedMethod("release")
- .createStrictMock();
- }
-
- @After
- public void tearDown() {
- verify(this.manager);
+ manager = spy(new StubDatabaseManager(name, buffer));
}
@Test
public void testStartupShutdown01() throws Exception {
- this.setUp("testName01", 0);
-
- replay(this.manager);
-
- assertEquals("The name is not correct.", "testName01", this.manager.getName());
- assertFalse("The manager should not have started.", this.manager.isRunning());
+ setUp("testName01", 0);
- verify(this.manager);
- reset(this.manager);
- this.manager.startupInternal();
- expectLastCall();
- replay(this.manager);
+ assertEquals("The name is not correct.", "testName01", manager.getName());
+ assertFalse("The manager should not have started.", manager.isRunning());
- this.manager.startup();
- assertTrue("The manager should be running now.", this.manager.isRunning());
+ manager.startup();
+ then(manager).should().startupInternal();
+ assertTrue("The manager should be running now.", manager.isRunning());
- verify(this.manager);
- reset(this.manager);
- this.manager.shutdownInternal();
- expectLastCall().andReturn(Boolean.TRUE);
- replay(this.manager);
-
- this.manager.shutdown();
- assertFalse("The manager should not be running anymore.", this.manager.isRunning());
+ manager.shutdown();
+ then(manager).should().shutdownInternal();
+ assertFalse("The manager should not be running anymore.", manager.isRunning());
}
@Test
public void testStartupShutdown02() throws Exception {
- this.setUp("anotherName02", 0);
-
- replay(this.manager);
-
- assertEquals("The name is not correct.", "anotherName02", this.manager.getName());
- assertFalse("The manager should not have started.", this.manager.isRunning());
+ setUp("anotherName02", 0);
- verify(this.manager);
- reset(this.manager);
- this.manager.startupInternal();
- expectLastCall();
- replay(this.manager);
+ assertEquals("The name is not correct.", "anotherName02", manager.getName());
+ assertFalse("The manager should not have started.", manager.isRunning());
- this.manager.startup();
- assertTrue("The manager should be running now.", this.manager.isRunning());
+ manager.startup();
+ then(manager).should().startupInternal();
+ assertTrue("The manager should be running now.", manager.isRunning());
- verify(this.manager);
- reset(this.manager);
- this.manager.shutdownInternal();
- expectLastCall().andReturn(Boolean.TRUE);
- replay(this.manager);
-
- this.manager.releaseSub(-1, null);
- assertFalse("The manager should not be running anymore.", this.manager.isRunning());
+ manager.releaseSub(-1, null);
+ then(manager).should().shutdownInternal();
+ assertFalse("The manager should not be running anymore.", manager.isRunning());
}
@Test
public void testToString01() {
- this.setUp("someName01", 0);
-
- replay(this.manager);
+ setUp("someName01", 0);
- assertEquals("The string is not correct.", "someName01", this.manager.toString());
+ assertEquals("The string is not correct.", "someName01", manager.toString());
}
@Test
public void testToString02() {
- this.setUp("bufferSize=12, anotherKey02=coolValue02", 12);
+ setUp("bufferSize=12, anotherKey02=coolValue02", 12);
- replay(this.manager);
-
- assertEquals("The string is not correct.", "bufferSize=12, anotherKey02=coolValue02", this.manager.toString());
+ assertEquals("The string is not correct.", "bufferSize=12, anotherKey02=coolValue02", manager.toString());
}
@Test
public void testBuffering01() throws Exception {
- this.setUp("name", 0);
-
- final LogEvent event1 = createStrictMock(LogEvent.class);
- final LogEvent event2 = createStrictMock(LogEvent.class);
- final LogEvent event3 = createStrictMock(LogEvent.class);
-
- this.manager.startupInternal();
- expectLastCall();
- replay(this.manager);
-
- this.manager.startup();
-
- verify(this.manager);
- reset(this.manager);
- this.manager.connectAndStart();
- expectLastCall();
- this.manager.writeInternal(same(event1));
- expectLastCall();
- this.manager.commitAndClose();
- expectLastCall().andReturn(Boolean.TRUE);
- replay(this.manager);
-
- this.manager.write(event1);
-
- verify(this.manager);
- reset(this.manager);
- this.manager.connectAndStart();
- expectLastCall();
- this.manager.writeInternal(same(event2));
- expectLastCall();
- this.manager.commitAndClose();
- expectLastCall().andReturn(Boolean.TRUE);
- replay(this.manager);
-
- this.manager.write(event2);
-
- verify(this.manager);
- reset(this.manager);
- this.manager.connectAndStart();
- expectLastCall();
- this.manager.writeInternal(same(event3));
- expectLastCall();
- this.manager.commitAndClose();
- expectLastCall().andReturn(Boolean.TRUE);
- replay(this.manager);
-
- this.manager.write(event3);
+ setUp("name", 0);
+
+ final LogEvent event1 = mock(LogEvent.class);
+ final LogEvent event2 = mock(LogEvent.class);
+ final LogEvent event3 = mock(LogEvent.class);
+
+ manager.startup();
+ then(manager).should().startupInternal();
+ reset(manager);
+
+ manager.write(event1);
+ then(manager).should().connectAndStart();
+ then(manager).should().writeInternal(same(event1));
+ then(manager).should().commitAndClose();
+ reset(manager);
+
+ manager.write(event2);
+ then(manager).should().connectAndStart();
+ then(manager).should().writeInternal(same(event2));
+ then(manager).should().commitAndClose();
+ reset(manager);
+
+ manager.write(event3);
+ then(manager).should().connectAndStart();
+ then(manager).should().writeInternal(same(event3));
+ then(manager).should().commitAndClose();
+ then(manager).shouldHaveNoMoreInteractions();
}
@Test
public void testBuffering02() throws Exception {
- this.setUp("name", 4);
-
- final LogEvent event1 = createStrictMock(LogEvent.class);
- final LogEvent event2 = createStrictMock(LogEvent.class);
- final LogEvent event3 = createStrictMock(LogEvent.class);
- final LogEvent event4 = createStrictMock(LogEvent.class);
-
- this.manager.startupInternal();
- expectLastCall();
- replay(this.manager);
-
- this.manager.startup();
-
- this.manager.write(event1);
- this.manager.write(event2);
- this.manager.write(event3);
-
- verify(this.manager);
- reset(this.manager);
- this.manager.connectAndStart();
- expectLastCall();
- this.manager.writeInternal(same(event1));
- expectLastCall();
- this.manager.writeInternal(same(event2));
- expectLastCall();
- this.manager.writeInternal(same(event3));
- expectLastCall();
- this.manager.writeInternal(same(event4));
- expectLastCall();
- this.manager.commitAndClose();
- expectLastCall().andReturn(Boolean.TRUE);
- replay(this.manager);
-
- this.manager.write(event4);
+ setUp("name", 4);
+
+ final LogEvent event1 = mock(LogEvent.class);
+ final LogEvent event2 = mock(LogEvent.class);
+ final LogEvent event3 = mock(LogEvent.class);
+ final LogEvent event4 = mock(LogEvent.class);
+
+ manager.startup();
+ then(manager).should().startupInternal();
+
+ manager.write(event1);
+ manager.write(event2);
+ manager.write(event3);
+ manager.write(event4);
+
+ then(manager).should().connectAndStart();
+ then(manager).should().writeInternal(same(event1));
+ then(manager).should().writeInternal(same(event2));
+ then(manager).should().writeInternal(same(event3));
+ then(manager).should().writeInternal(same(event4));
+ then(manager).should().commitAndClose();
+ then(manager).shouldHaveNoMoreInteractions();
}
@Test
public void testBuffering03() throws Exception {
- this.setUp("name", 10);
-
- final LogEvent event1 = createStrictMock(LogEvent.class);
- final LogEvent event2 = createStrictMock(LogEvent.class);
- final LogEvent event3 = createStrictMock(LogEvent.class);
-
- this.manager.startupInternal();
- expectLastCall();
- replay(this.manager);
-
- this.manager.startup();
-
- this.manager.write(event1);
- this.manager.write(event2);
- this.manager.write(event3);
-
- verify(this.manager);
- reset(this.manager);
- this.manager.connectAndStart();
- expectLastCall();
- this.manager.writeInternal(same(event1));
- expectLastCall();
- this.manager.writeInternal(same(event2));
- expectLastCall();
- this.manager.writeInternal(same(event3));
- expectLastCall();
- this.manager.commitAndClose();
- expectLastCall().andReturn(Boolean.TRUE);
- replay(this.manager);
-
- this.manager.flush();
+ setUp("name", 10);
+
+ final LogEvent event1 = mock(LogEvent.class);
+ final LogEvent event2 = mock(LogEvent.class);
+ final LogEvent event3 = mock(LogEvent.class);
+
+ manager.startup();
+ then(manager).should().startupInternal();
+
+ manager.write(event1);
+ manager.write(event2);
+ manager.write(event3);
+ manager.flush();
+
+ then(manager).should().connectAndStart();
+ then(manager).should().writeInternal(same(event1));
+ then(manager).should().writeInternal(same(event2));
+ then(manager).should().writeInternal(same(event3));
+ then(manager).should().commitAndClose();
+ then(manager).shouldHaveNoMoreInteractions();
}
@Test
public void testBuffering04() throws Exception {
- this.setUp("name", 10);
-
- final LogEvent event1 = createStrictMock(LogEvent.class);
- final LogEvent event2 = createStrictMock(LogEvent.class);
- final LogEvent event3 = createStrictMock(LogEvent.class);
-
- this.manager.startupInternal();
- expectLastCall();
- replay(this.manager);
-
- this.manager.startup();
-
- this.manager.write(event1);
- this.manager.write(event2);
- this.manager.write(event3);
-
- verify(this.manager);
- reset(this.manager);
- this.manager.connectAndStart();
- expectLastCall();
- this.manager.writeInternal(same(event1));
- expectLastCall();
- this.manager.writeInternal(same(event2));
- expectLastCall();
- this.manager.writeInternal(same(event3));
- expectLastCall();
- this.manager.commitAndClose();
- expectLastCall().andReturn(Boolean.TRUE);
- this.manager.shutdownInternal();
- expectLastCall().andReturn(Boolean.TRUE);
- replay(this.manager);
-
- this.manager.shutdown();
+ setUp("name", 10);
+
+ final LogEvent event1 = mock(LogEvent.class);
+ final LogEvent event2 = mock(LogEvent.class);
+ final LogEvent event3 = mock(LogEvent.class);
+
+ manager.startup();
+ then(manager).should().startupInternal();
+
+ manager.write(event1);
+ manager.write(event2);
+ manager.write(event3);
+ manager.shutdown();
+
+ then(manager).should().connectAndStart();
+ then(manager).should().writeInternal(same(event1));
+ then(manager).should().writeInternal(same(event2));
+ then(manager).should().writeInternal(same(event3));
+ then(manager).should().commitAndClose();
+ then(manager).should().shutdownInternal();
+ then(manager).shouldHaveNoMoreInteractions();
+ }
+
+ // this stub is provided because mocking constructors is hard
+ private static class StubDatabaseManager extends AbstractDatabaseManager {
+
+ protected StubDatabaseManager(final String name, final int bufferSize) {
+ super(name, bufferSize);
+ }
+
+ @Override
+ protected void startupInternal() throws Exception {
+ }
+
+ @Override
+ protected boolean shutdownInternal() throws Exception {
+ return true;
+ }
+
+ @Override
+ protected void connectAndStart() {
+ }
+
+ @Override
+ protected void writeInternal(final LogEvent event) {
+ }
+
+ @Override
+ protected boolean commitAndClose() {
+ return true;
+ }
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractJdbcAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractJdbcAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractJdbcAppenderTest.java
index 881eab9..99c229d 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractJdbcAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/AbstractJdbcAppenderTest.java
@@ -22,7 +22,6 @@ import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
-
import javax.naming.InitialContext;
import javax.sql.DataSource;
@@ -34,15 +33,16 @@ import org.apache.logging.log4j.core.config.ConfigurationFactory;
import org.apache.logging.log4j.core.config.DefaultConfiguration;
import org.apache.logging.log4j.status.StatusLogger;
import org.apache.logging.log4j.util.Strings;
-import org.easymock.IAnswer;
import org.h2.util.IOUtils;
import org.junit.After;
import org.junit.Test;
import org.mockejb.jndi.MockContextFactory;
-
-import static org.easymock.EasyMock.*;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.Mockito.mock;
public abstract class AbstractJdbcAppenderTest {
private final String databaseType;
@@ -93,15 +93,13 @@ public abstract class AbstractJdbcAppenderTest {
@Test
public void testDataSourceConfig() throws Exception {
- final DataSource dataSource = createStrictMock(DataSource.class);
-
- expect(dataSource.getConnection()).andAnswer(new IAnswer<Connection>() {
+ final DataSource dataSource = mock(DataSource.class);
+ given(dataSource.getConnection()).willAnswer(new Answer<Connection>() {
@Override
- public Connection answer() throws Throwable {
+ public Connection answer(final InvocationOnMock invocation) throws Throwable {
return newConnection();
}
- }).atLeastOnce();
- replay(dataSource);
+ });
MockContextFactory.setAsInitial();
@@ -147,8 +145,6 @@ public abstract class AbstractJdbcAppenderTest {
IOUtils.readStringAndClose(resultSet.getNClob("exception").getCharacterStream(), -1));
assertFalse("There should not be two rows.", resultSet.next());
-
- verify(dataSource);
} finally {
MockContextFactory.revertSetAsInitial();
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/DataSourceConnectionSourceTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/DataSourceConnectionSourceTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/DataSourceConnectionSourceTest.java
index 7da9cb5..65ff060 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/DataSourceConnectionSourceTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/DataSourceConnectionSourceTest.java
@@ -20,7 +20,6 @@ import java.sql.Connection;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.Collection;
-
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
@@ -37,9 +36,9 @@ import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.mockejb.jndi.MockContextFactory;
-import static org.easymock.EasyMock.*;
-
import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.Mockito.mock;
@RunWith(Parameterized.class)
public class DataSourceConnectionSourceTest {
@@ -112,13 +111,11 @@ public class DataSourceConnectionSourceTest {
@Test
public void testDataSource() throws NamingException, SQLException {
- final DataSource dataSource = createStrictMock(DataSource.class);
- final Connection connection1 = createStrictMock(Connection.class);
- final Connection connection2 = createStrictMock(Connection.class);
+ final DataSource dataSource = mock(DataSource.class);
+ final Connection connection1 = mock(Connection.class);
+ final Connection connection2 = mock(Connection.class);
- expect(dataSource.getConnection()).andReturn(connection1);
- expect(dataSource.getConnection()).andReturn(connection2);
- replay(dataSource, connection1, connection2);
+ given(dataSource.getConnection()).willReturn(connection1, connection2);
this.context.bind(this.jndiURL, dataSource);
@@ -134,8 +131,6 @@ public class DataSourceConnectionSourceTest {
source = DataSourceConnectionSource.createConnectionSource(jndiURL.substring(0, jndiURL.length() - 1));
assertNull("The connection source should be null now.", source);
-
- verify(dataSource, connection1, connection2);
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/FactoryMethodConnectionSourceTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/FactoryMethodConnectionSourceTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/FactoryMethodConnectionSourceTest.java
index cb02543..e8a99b7 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/FactoryMethodConnectionSourceTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/db/jdbc/FactoryMethodConnectionSourceTest.java
@@ -18,46 +18,23 @@ package org.apache.logging.log4j.core.appender.db.jdbc;
import java.sql.Connection;
import java.sql.SQLException;
-
import javax.sql.DataSource;
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.core.LoggerContext;
-import org.apache.logging.log4j.core.config.ConfigurationFactory;
-import org.apache.logging.log4j.status.StatusLogger;
+import org.apache.logging.log4j.junit.LoggerContextRule;
import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
+import org.junit.ClassRule;
import org.junit.Test;
-import static org.easymock.EasyMock.*;
-
import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.Mockito.mock;
public class FactoryMethodConnectionSourceTest {
private static ThreadLocal<Object> holder = new ThreadLocal<>();
private static final String CONFIG = "log4j-fatalOnly.xml";
- @BeforeClass
- public static void beforeClass() {
- System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG);
- final LoggerContext ctx = LoggerContext.getContext();
- ctx.reconfigure();
- final StatusLogger logger = StatusLogger.getLogger();
- logger.setLevel(Level.FATAL);
- }
-
- @AfterClass
- public static void tearDownClass() {
- holder.remove();
- holder = null;
- }
-
- @Before
- public void setUp() {
-
- }
+ @ClassRule
+ public static LoggerContextRule ctx = new LoggerContextRule(CONFIG);
@After
public void tearDown() {
@@ -107,13 +84,11 @@ public class FactoryMethodConnectionSourceTest {
@Test
public void testDataSourceReturnType() throws SQLException {
- final DataSource dataSource = createStrictMock(DataSource.class);
- final Connection connection1 = createStrictMock(Connection.class);
- final Connection connection2 = createStrictMock(Connection.class);
+ final DataSource dataSource = mock(DataSource.class);
+ final Connection connection1 = mock(Connection.class);
+ final Connection connection2 = mock(Connection.class);
- expect(dataSource.getConnection()).andReturn(connection1);
- expect(dataSource.getConnection()).andReturn(connection2);
- replay(dataSource, connection1, connection2);
+ given(dataSource.getConnection()).willReturn(connection1, connection2);
holder.set(dataSource);
@@ -126,15 +101,11 @@ public class FactoryMethodConnectionSourceTest {
+ "] " + DataSourceFactory.class.getName() + ".factoryMethod02() }", source.toString());
assertSame("The connection is not correct (1).", connection1, source.getConnection());
assertSame("The connection is not correct (2).", connection2, source.getConnection());
-
- verify(connection1, connection2);
}
@Test
public void testConnectionReturnType() throws SQLException {
- final Connection connection = createStrictMock(Connection.class);
-
- replay(connection);
+ final Connection connection = mock(Connection.class);
holder.set(connection);
@@ -147,8 +118,6 @@ public class FactoryMethodConnectionSourceTest {
+ ConnectionFactory.class.getName() + ".anotherMethod03() }", source.toString());
assertSame("The connection is not correct (1).", connection, source.getConnection());
assertSame("The connection is not correct (2).", connection, source.getConnection());
-
- verify(connection);
}
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/Log4jLookupTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/Log4jLookupTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/Log4jLookupTest.java
index 3059a9a..0db5db0 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/Log4jLookupTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/Log4jLookupTest.java
@@ -23,48 +23,43 @@ import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.ConfigurationAware;
import org.apache.logging.log4j.core.config.ConfigurationSource;
import org.apache.logging.log4j.core.impl.ContextAnchor;
-import org.easymock.EasyMock;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
import static org.apache.logging.log4j.core.lookup.Log4jLookup.KEY_CONFIG_LOCATION;
import static org.apache.logging.log4j.core.lookup.Log4jLookup.KEY_CONFIG_PARENT_LOCATION;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.given;
/**
*
*/
+@RunWith(MockitoJUnitRunner.class)
public class Log4jLookupTest {
private final static File EXPECT = new File(System.getProperty("user.home"), "/a/b/c/d/e/log4j2.xml");
- private LoggerContext mockCtx = null;
- private Configuration config = null;
- private ConfigurationSource configSrc = null;
+
+ @Mock
+ private LoggerContext mockCtx;
+ @Mock
+ private Configuration config;
+ @Mock
+ private ConfigurationSource configSrc;
@Before
public void setup() throws URISyntaxException {
- this.mockCtx = EasyMock.createMock(LoggerContext.class);
ContextAnchor.THREAD_CONTEXT.set(mockCtx);
-
- this.config = EasyMock.createMock(Configuration.class);
-
- this.configSrc = EasyMock.createMock(ConfigurationSource.class);
- expect(config.getConfigurationSource()).andReturn(configSrc);
- expect(configSrc.getFile()).andReturn(EXPECT);
-
- replay(mockCtx, config, configSrc);
+ given(config.getConfigurationSource()).willReturn(configSrc);
+ given(configSrc.getFile()).willReturn(EXPECT);
}
@After
public void cleanup() {
- verify(mockCtx, config, configSrc);
-
ContextAnchor.THREAD_CONTEXT.set(null);
- this.mockCtx = null;
}
@Test
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/Log4jLookupWithSpacesTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/Log4jLookupWithSpacesTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/Log4jLookupWithSpacesTest.java
index 7b88ad4..e5ecb49 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/Log4jLookupWithSpacesTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/Log4jLookupWithSpacesTest.java
@@ -24,47 +24,42 @@ import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.ConfigurationAware;
import org.apache.logging.log4j.core.config.ConfigurationSource;
import org.apache.logging.log4j.core.impl.ContextAnchor;
-import org.easymock.EasyMock;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
-import static org.apache.logging.log4j.core.lookup.Log4jLookup.*;
-
-import static org.easymock.EasyMock.*;
-
+import static org.apache.logging.log4j.core.lookup.Log4jLookup.KEY_CONFIG_LOCATION;
+import static org.apache.logging.log4j.core.lookup.Log4jLookup.KEY_CONFIG_PARENT_LOCATION;
import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.given;
/**
*
*/
+@RunWith(MockitoJUnitRunner.class)
public class Log4jLookupWithSpacesTest {
private final static File EXPECT = new File(System.getProperty("user.home"), "/a a/b b/c c/d d/e e/log4j2 file.xml");
- private LoggerContext mockCtx = null;
- private Configuration config = null;
- private ConfigurationSource configSrc = null;
+ @Mock
+ private LoggerContext mockCtx;
+ @Mock
+ private Configuration config;
+ @Mock
+ private ConfigurationSource configSrc;
@Before
public void setup() throws URISyntaxException, MalformedURLException {
- this.mockCtx = EasyMock.createMock(LoggerContext.class);
ContextAnchor.THREAD_CONTEXT.set(mockCtx);
-
- this.config = EasyMock.createMock(Configuration.class);
-
- this.configSrc = EasyMock.createMock(ConfigurationSource.class);
- expect(config.getConfigurationSource()).andReturn(configSrc);
- expect(configSrc.getFile()).andReturn(EXPECT);
-
- replay(mockCtx, config, configSrc);
+ given(config.getConfigurationSource()).willReturn(configSrc);
+ given(configSrc.getFile()).willReturn(EXPECT);
}
@After
public void cleanup() {
- verify(mockCtx, config, configSrc);
-
ContextAnchor.THREAD_CONTEXT.set(null);
- this.mockCtx = null;
}
@Test
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-iostreams/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-iostreams/pom.xml b/log4j-iostreams/pom.xml
index c818aae..1ca56b4 100644
--- a/log4j-iostreams/pom.xml
+++ b/log4j-iostreams/pom.xml
@@ -63,8 +63,8 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerOutputStreamTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerOutputStreamTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerOutputStreamTest.java
index 2f4f573..188b422 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerOutputStreamTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerOutputStreamTest.java
@@ -20,13 +20,12 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
-import org.easymock.EasyMock;
import org.junit.Before;
import org.junit.Test;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.then;
+import static org.mockito.Mockito.mock;
public abstract class AbstractLoggerOutputStreamTest extends AbstractStreamTest {
@@ -63,10 +62,7 @@ public abstract class AbstractLoggerOutputStreamTest extends AbstractStreamTest
@Test
public void testFlush() throws IOException {
- final OutputStream os = EasyMock.createMock("out", OutputStream.class);
- os.flush(); // expect the flush to come through to the mocked OutputStream
- os.close();
- replay(os);
+ final OutputStream os = mock(OutputStream.class);
try (final OutputStream filteredOut =
IoBuilder.forLogger(getExtendedLogger())
@@ -75,7 +71,10 @@ public abstract class AbstractLoggerOutputStreamTest extends AbstractStreamTest
.buildOutputStream()) {
filteredOut.flush();
}
- verify(os);
+
+ then(os).should().flush();
+ then(os).should().close();
+ then(os).shouldHaveNoMoreInteractions();
}
@Test
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerWriterTest.java
----------------------------------------------------------------------
diff --git a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerWriterTest.java b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerWriterTest.java
index c40cdf6..7560546 100644
--- a/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerWriterTest.java
+++ b/log4j-iostreams/src/test/java/org/apache/logging/log4j/io/AbstractLoggerWriterTest.java
@@ -21,13 +21,12 @@ import java.io.OutputStream;
import java.io.StringWriter;
import java.io.Writer;
-import org.easymock.EasyMock;
import org.junit.Before;
import org.junit.Test;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.then;
+import static org.mockito.Mockito.mock;
public abstract class AbstractLoggerWriterTest extends AbstractStreamTest {
protected StringWriter wrapped;
@@ -65,10 +64,7 @@ public abstract class AbstractLoggerWriterTest extends AbstractStreamTest {
@Test
public void testFlush() throws IOException {
- final OutputStream out = EasyMock.createMock(OutputStream.class);
- out.flush(); // expect the flush to come through to the mocked OutputStream
- out.close();
- replay(out);
+ final OutputStream out = mock(OutputStream.class);
try (final OutputStream filteredOut =
IoBuilder.forLogger(getExtendedLogger())
@@ -77,7 +73,10 @@ public abstract class AbstractLoggerWriterTest extends AbstractStreamTest {
.buildOutputStream()) {
filteredOut.flush();
}
- verify(out);
+
+ then(out).should().flush();
+ then(out).should().close();
+ then(out).shouldHaveNoMoreInteractions();
}
@Test
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-nosql/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-nosql/pom.xml b/log4j-nosql/pom.xml
index ccf44e9..0ec75f5 100644
--- a/log4j-nosql/pom.xml
+++ b/log4j-nosql/pom.xml
@@ -54,8 +54,9 @@
<artifactId>junit</artifactId>
</dependency>
<dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlAppenderTest.java b/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlAppenderTest.java
index c48cf0a..236218c 100644
--- a/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlAppenderTest.java
+++ b/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlAppenderTest.java
@@ -16,17 +16,19 @@
*/
package org.apache.logging.log4j.nosql.appender;
-import static org.easymock.EasyMock.createStrictMock;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import static org.junit.Assert.*;
+@RunWith(MockitoJUnitRunner.class)
public class NoSqlAppenderTest {
+ @Mock
+ private NoSqlProvider<?> provider;
+
@Test
public void testNoProvider() {
final NoSqlAppender appender = NoSqlAppender.createAppender("myName01", null, null, null, null);
@@ -36,11 +38,6 @@ public class NoSqlAppenderTest {
@Test
public void testProvider() {
- @SuppressWarnings("unchecked")
- final NoSqlProvider<?> provider = createStrictMock(NoSqlProvider.class);
-
- replay(provider);
-
final NoSqlAppender appender = NoSqlAppender.createAppender("myName01", null, null, null, provider);
assertNotNull("The appender should not be null.", appender);
@@ -49,17 +46,10 @@ public class NoSqlAppenderTest {
appender.toString());
appender.stop();
-
- verify(provider);
}
@Test
public void testProviderBuffer() {
- @SuppressWarnings("unchecked")
- final NoSqlProvider<?> provider = createStrictMock(NoSqlProvider.class);
-
- replay(provider);
-
final NoSqlAppender appender = NoSqlAppender.createAppender("anotherName02", null, null, "25", provider);
assertNotNull("The appender should not be null.", appender);
@@ -68,7 +58,5 @@ public class NoSqlAppenderTest {
+ " } }", appender.toString());
appender.stop();
-
- verify(provider);
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java
----------------------------------------------------------------------
diff --git a/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java b/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java
index 2f597b5..af55e2c 100644
--- a/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java
+++ b/log4j-nosql/src/test/java/org/apache/logging/log4j/nosql/appender/NoSqlDatabaseManagerTest.java
@@ -16,23 +16,9 @@
*/
package org.apache.logging.log4j.nosql.appender;
-import static org.easymock.EasyMock.anyInt;
-import static org.easymock.EasyMock.capture;
-import static org.easymock.EasyMock.createStrictMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.getCurrentArguments;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.reset;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
import java.io.IOException;
import java.sql.SQLException;
+import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -43,173 +29,132 @@ import org.apache.logging.log4j.MarkerManager;
import org.apache.logging.log4j.ThreadContext;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.appender.AppenderLoggingException;
+import org.apache.logging.log4j.core.impl.Log4jLogEvent;
import org.apache.logging.log4j.junit.ThreadContextStackRule;
import org.apache.logging.log4j.message.Message;
-import org.easymock.Capture;
-import org.easymock.EasyMock;
-import org.easymock.IAnswer;
-import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.stubbing.Answer;
+
+import static org.junit.Assert.*;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.BDDMockito.then;
+import static org.mockito.Mockito.mock;
+
+@RunWith(MockitoJUnitRunner.class)
public class NoSqlDatabaseManagerTest {
+ @Mock
private NoSqlConnection<Map<String, Object>, DefaultNoSqlObject> connection;
+ @Mock
private NoSqlProvider<NoSqlConnection<Map<String, Object>, DefaultNoSqlObject>> provider;
+ @Mock
+ private Message message;
+ @Captor
+ private ArgumentCaptor<NoSqlObject<Map<String, Object>>> captor;
@Rule
- public final ThreadContextStackRule threadContextRule = new ThreadContextStackRule();
+ public final ThreadContextStackRule threadContextRule = new ThreadContextStackRule();
+ @Rule
+ public final ExpectedException expectedException = ExpectedException.none();
@Before
public void setUp() {
- this.provider = createStrictMock(NoSqlProvider.class);
- this.connection = createStrictMock(NoSqlConnection.class);
- }
-
- @After
- public void tearDown() {
- verify(this.provider, this.connection);
+ given(provider.getConnection()).willReturn(connection);
+ given(connection.createObject()).willAnswer(new Answer<DefaultNoSqlObject>() {
+ @Override
+ public DefaultNoSqlObject answer(final InvocationOnMock invocation) throws Throwable {
+ return new DefaultNoSqlObject();
+ }
+ });
+ given(connection.createList(anyInt())).willAnswer(new Answer<DefaultNoSqlObject[]>() {
+ @Override
+ public DefaultNoSqlObject[] answer(final InvocationOnMock invocation) throws Throwable {
+ return new DefaultNoSqlObject[invocation.<Integer>getArgument(0)];
+ }
+ });
}
@Test
- public void testConnection() {
- replay(this.provider, this.connection);
-
- try (final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDatabaseManager("name", 0,
- this.provider)) {
-
- assertNotNull("The manager should not be null.", manager);
+ public void testConnection() {
+ try (final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDatabaseManager("name", 0,
+ provider)) {
- verify(this.provider, this.connection);
- reset(this.provider, this.connection);
- expect(this.provider.getConnection()).andReturn(this.connection);
- replay(this.provider, this.connection);
+ assertNotNull("The manager should not be null.", manager);
- manager.connectAndStart();
- manager.commitAndClose();
- }
- }
+ manager.connectAndStart();
+ then(provider).should().getConnection();
+ manager.commitAndClose();
+ }
+ }
@Test
- public void testWriteInternalNotConnected01() {
- replay(this.provider, this.connection);
-
- try (final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDatabaseManager("name", 0,
- this.provider)) {
-
- verify(this.provider, this.connection);
- reset(this.provider, this.connection);
-
- final LogEvent event = createStrictMock(LogEvent.class);
- replay(this.provider, this.connection, event);
-
- try {
- manager.writeInternal(event);
- fail("Expected AppenderLoggingException.");
- } catch (final AppenderLoggingException ignore) {
- /* */
- }
-
- verify(event);
- }
- }
+ public void testWriteInternalNotConnected01() {
+ try (final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDatabaseManager("name", 0,
+ provider)) {
+ expectedException.expect(AppenderLoggingException.class);
+ manager.writeInternal(mock(LogEvent.class));
+ }
+ }
@Test
public void testWriteInternalNotConnected02() {
- final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDatabaseManager("name", 0, this.provider);
+ given(connection.isClosed()).willReturn(true);
- try {
- replay(this.provider, this.connection);
+ try (final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDatabaseManager("name", 0,
+ provider)) {
manager.startup();
-
- verify(this.provider, this.connection);
- reset(this.provider, this.connection);
- expect(this.provider.getConnection()).andReturn(this.connection);
- replay(this.provider, this.connection);
-
manager.connectAndStart();
+ then(provider).should().getConnection();
- verify(this.provider, this.connection);
- reset(this.provider, this.connection);
-
- final LogEvent event = createStrictMock(LogEvent.class);
- expect(this.connection.isClosed()).andReturn(true);
- replay(this.provider, this.connection, event);
-
- try {
- manager.writeInternal(event);
- fail("Expected AppenderLoggingException.");
- } catch (final AppenderLoggingException ignore) {
- /* */
- }
- } finally {
- try {
- manager.close();
- } catch (final Throwable ignore) {
- /* */
- }
+ expectedException.expect(AppenderLoggingException.class);
+ manager.writeInternal(mock(LogEvent.class));
}
}
@Test
public void testWriteInternal01() {
- final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDatabaseManager("name", 0, this.provider);
+ given(connection.isClosed()).willReturn(false);
+ given(message.getFormattedMessage()).willReturn("My formatted message 01.");
- try {
- replay(this.provider, this.connection);
+ try (final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDatabaseManager("name", 0,
+ provider)) {
manager.startup();
-
- verify(this.provider, this.connection);
- reset(this.provider, this.connection);
- expect(this.provider.getConnection()).andReturn(this.connection);
- replay(this.provider, this.connection);
-
manager.connectAndStart();
-
- verify(this.provider, this.connection);
- reset(this.provider, this.connection);
-
- final Capture<NoSqlObject<Map<String, Object>>> capture = EasyMock.newCapture();
-
- final LogEvent event = createStrictMock(LogEvent.class);
- final Message message = createStrictMock(Message.class);
-
- expect(this.connection.isClosed()).andReturn(false);
- expect(this.connection.createObject()).andAnswer(new IAnswer<DefaultNoSqlObject>() {
- @Override
- public DefaultNoSqlObject answer() throws Throwable {
- return new DefaultNoSqlObject();
- }
- }).atLeastOnce();
- expect(event.getLevel()).andReturn(Level.WARN);
- expect(event.getLoggerName()).andReturn("com.foo.NoSQLDbTest.testWriteInternal01");
- expect(event.getMessage()).andReturn(message).times(2);
- expect(message.getFormattedMessage()).andReturn("My formatted message 01.");
- expect(event.getSource()).andReturn(new StackTraceElement("com.foo.Bar", "testMethod01", "Bar.java", 15));
- expect(event.getMarker()).andReturn(null);
- expect(event.getThreadId()).andReturn(1L);
- expect(event.getThreadName()).andReturn("MyThread-A");
- expect(event.getThreadPriority()).andReturn(1);
- expect(event.getTimeMillis()).andReturn(1234567890123L).times(2);
- expect(event.getThrown()).andReturn(null);
- expect(event.getContextMap()).andReturn(null);
- expect(event.getContextStack()).andReturn(null);
- this.connection.insertObject(capture(capture));
- expectLastCall();
- replay(this.provider, this.connection, event, message);
+ then(provider).should().getConnection();
+
+ final LogEvent event = Log4jLogEvent.newBuilder()
+ .setLevel(Level.WARN)
+ .setLoggerName("com.foo.NoSQLDbTest.testWriteInternal01")
+ .setMessage(message)
+ .setSource(new StackTraceElement("com.foo.Bar", "testMethod01", "Bar.java", 15))
+ .setThreadId(1L)
+ .setThreadName("MyThread-A")
+ .setThreadPriority(1)
+ .setTimeMillis(1234567890123L)
+ .build();
manager.writeInternal(event);
+ then(connection).should().insertObject(captor.capture());
- final NoSqlObject<Map<String, Object>> inserted = capture.getValue();
+ final NoSqlObject<Map<String, Object>> inserted = captor.getValue();
assertNotNull("The inserted value should not be null.", inserted);
final Map<String, Object> object = inserted.unwrap();
assertNotNull("The unwrapped object should not be null.", object);
assertEquals("The level is not correct.", Level.WARN, object.get("level"));
assertEquals("The logger is not correct.", "com.foo.NoSQLDbTest.testWriteInternal01",
- object.get("loggerName"));
+ object.get("loggerName"));
assertEquals("The message is not correct.", "My formatted message 01.", object.get("message"));
assertEquals("The thread is not correct.", "MyThread-A", object.get("threadName"));
assertEquals("The millis is not correct.", 1234567890123L, object.get("millis"));
@@ -227,99 +172,61 @@ public class NoSqlDatabaseManagerTest {
assertNull("The thrown should be null.", object.get("thrown"));
- assertNull("The context map should be null.", object.get("contextMap"));
+ assertTrue("The context map should be empty.", ((Map) object.get("contextMap")).isEmpty());
- assertNull("The context stack should be null.", object.get("contextStack"));
+ assertTrue("The context stack should be null.", ((Collection) object.get("contextStack")).isEmpty());
- verify(this.provider, this.connection, event, message);
- } finally {
- try {
- manager.close();
- } catch (final Throwable ignore) {
- /* */
- }
}
}
@Test
public void testWriteInternal02() {
- final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDatabaseManager("name", 0, this.provider);
-
- try {
- replay(this.provider, this.connection);
+ given(connection.isClosed()).willReturn(false);
+ given(message.getFormattedMessage()).willReturn("Another cool message 02.");
+ try (final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDatabaseManager("name", 0,
+ provider)) {
manager.startup();
- verify(this.provider, this.connection);
- reset(this.provider, this.connection);
- expect(this.provider.getConnection()).andReturn(this.connection);
- replay(this.provider, this.connection);
-
manager.connectAndStart();
-
- verify(this.provider, this.connection);
- reset(this.provider, this.connection);
-
- final Capture<NoSqlObject<Map<String, Object>>> capture = EasyMock.newCapture();
+ then(provider).should().getConnection();
final RuntimeException exception = new RuntimeException("This is something cool!");
final Map<String, String> context = new HashMap<>();
context.put("hello", "world");
context.put("user", "pass");
- final LogEvent event = createStrictMock(LogEvent.class);
- final Message message = createStrictMock(Message.class);
ThreadContext.push("message1");
ThreadContext.push("stack2");
final ThreadContext.ContextStack stack = ThreadContext.getImmutableStack();
ThreadContext.clearStack();
- expect(this.connection.isClosed()).andReturn(false);
- expect(this.connection.createObject()).andAnswer(new IAnswer<DefaultNoSqlObject>() {
- @Override
- public DefaultNoSqlObject answer() throws Throwable {
- return new DefaultNoSqlObject();
- }
- }).atLeastOnce();
- expect(this.connection.createList(anyInt())).andAnswer(new IAnswer<DefaultNoSqlObject[]>() {
- @Override
- public DefaultNoSqlObject[] answer() throws Throwable {
- return new DefaultNoSqlObject[(Integer) getCurrentArguments()[0]];
- }
- });
- expect(this.connection.createObject()).andAnswer(new IAnswer<DefaultNoSqlObject>() {
- @Override
- public DefaultNoSqlObject answer() throws Throwable {
- return new DefaultNoSqlObject();
- }
- }).atLeastOnce();
- expect(event.getLevel()).andReturn(Level.DEBUG);
- expect(event.getLoggerName()).andReturn("com.foo.NoSQLDbTest.testWriteInternal02");
- expect(event.getMessage()).andReturn(message).times(2);
- expect(message.getFormattedMessage()).andReturn("Another cool message 02.");
- expect(event.getSource()).andReturn(new StackTraceElement("com.bar.Foo", "anotherMethod03", "Foo.java", 9));
- expect(event.getMarker()).andReturn(MarkerManager.getMarker("LoneMarker"));
- expect(event.getThreadId()).andReturn(1L);
- expect(event.getThreadName()).andReturn("AnotherThread-B");
- expect(event.getThreadPriority()).andReturn(1);
- expect(event.getTimeMillis()).andReturn(987654321564L).times(2);
- expect(event.getThrown()).andReturn(exception);
- expect(event.getContextMap()).andReturn(context);
- expect(event.getContextStack()).andReturn(stack);
- this.connection.insertObject(capture(capture));
- expectLastCall();
- replay(this.provider, this.connection, event, message);
+ final LogEvent event = Log4jLogEvent.newBuilder()
+ .setLevel(Level.DEBUG)
+ .setLoggerName("com.foo.NoSQLDbTest.testWriteInternal02")
+ .setMessage(message)
+ .setSource(new StackTraceElement("com.bar.Foo", "anotherMethod03", "Foo.java", 9))
+ .setMarker(MarkerManager.getMarker("LoneMarker"))
+ .setThreadId(1L)
+ .setThreadName("AnotherThread-B")
+ .setThreadPriority(1)
+ .setTimeMillis(987654321564L)
+ .setThrown(exception)
+ .setContextMap(context)
+ .setContextStack(stack)
+ .build();
manager.writeInternal(event);
+ then(connection).should().insertObject(captor.capture());
- final NoSqlObject<Map<String, Object>> inserted = capture.getValue();
+ final NoSqlObject<Map<String, Object>> inserted = captor.getValue();
assertNotNull("The inserted value should not be null.", inserted);
final Map<String, Object> object = inserted.unwrap();
assertNotNull("The unwrapped object should not be null.", object);
assertEquals("The level is not correct.", Level.DEBUG, object.get("level"));
assertEquals("The logger is not correct.", "com.foo.NoSQLDbTest.testWriteInternal02",
- object.get("loggerName"));
+ object.get("loggerName"));
assertEquals("The message is not correct.", "Another cool message 02.", object.get("message"));
assertEquals("The thread is not correct.", "AnotherThread-B", object.get("threadName"));
assertEquals("The millis is not correct.", 987654321564L, object.get("millis"));
@@ -348,17 +255,17 @@ public class NoSqlDatabaseManagerTest {
@SuppressWarnings("unchecked")
final List<Map<String, Object>> stackTrace = (List<Map<String, Object>>) thrown.get("stackTrace");
assertEquals("The thrown stack trace length is not correct.", exception.getStackTrace().length,
- stackTrace.size());
+ stackTrace.size());
for (int i = 0; i < exception.getStackTrace().length; i++) {
final StackTraceElement e1 = exception.getStackTrace()[i];
final Map<String, Object> e2 = stackTrace.get(i);
assertEquals("Element class name [" + i + "] is not correct.", e1.getClassName(), e2.get("className"));
assertEquals("Element method name [" + i + "] is not correct.", e1.getMethodName(),
- e2.get("methodName"));
+ e2.get("methodName"));
assertEquals("Element file name [" + i + "] is not correct.", e1.getFileName(), e2.get("fileName"));
assertEquals("Element line number [" + i + "] is not correct.", e1.getLineNumber(),
- e2.get("lineNumber"));
+ e2.get("lineNumber"));
}
assertNull("The thrown should have no cause.", thrown.get("cause"));
@@ -367,37 +274,20 @@ public class NoSqlDatabaseManagerTest {
assertTrue("The context stack should be list.", object.get("contextStack") instanceof List);
assertEquals("The context stack is not correct.", stack.asList(), object.get("contextStack"));
-
- verify(this.provider, this.connection, event, message);
- } finally {
- try {
- manager.close();
- } catch (final Throwable ignore) {
- /* */
- }
}
}
@Test
public void testWriteInternal03() {
- final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDatabaseManager("name", 0, this.provider);
-
- try {
- replay(this.provider, this.connection);
+ given(connection.isClosed()).willReturn(false);
+ given(message.getFormattedMessage()).willReturn("Another cool message 02.");
+ try (final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDatabaseManager("name", 0,
+ provider)) {
manager.startup();
- verify(this.provider, this.connection);
- reset(this.provider, this.connection);
- expect(this.provider.getConnection()).andReturn(this.connection);
- replay(this.provider, this.connection);
-
manager.connectAndStart();
-
- verify(this.provider, this.connection);
- reset(this.provider, this.connection);
-
- final Capture<NoSqlObject<Map<String, Object>>> capture = EasyMock.newCapture();
+ then(provider).should().getConnection();
final IOException exception1 = new IOException("This is the cause.");
final SQLException exception2 = new SQLException("This is the result.", exception1);
@@ -405,73 +295,39 @@ public class NoSqlDatabaseManagerTest {
context.put("hello", "world");
context.put("user", "pass");
- final LogEvent event = createStrictMock(LogEvent.class);
- final Message message = createStrictMock(Message.class);
ThreadContext.push("message1");
ThreadContext.push("stack2");
final ThreadContext.ContextStack stack = ThreadContext.getImmutableStack();
ThreadContext.clearStack();
- expect(this.connection.isClosed()).andReturn(false);
- expect(this.connection.createObject()).andAnswer(new IAnswer<DefaultNoSqlObject>() {
- @Override
- public DefaultNoSqlObject answer() throws Throwable {
- return new DefaultNoSqlObject();
- }
- }).atLeastOnce();
- expect(this.connection.createList(anyInt())).andAnswer(new IAnswer<DefaultNoSqlObject[]>() {
- @Override
- public DefaultNoSqlObject[] answer() throws Throwable {
- return new DefaultNoSqlObject[(Integer) getCurrentArguments()[0]];
- }
- });
- expect(this.connection.createObject()).andAnswer(new IAnswer<DefaultNoSqlObject>() {
- @Override
- public DefaultNoSqlObject answer() throws Throwable {
- return new DefaultNoSqlObject();
- }
- }).atLeastOnce();
- expect(this.connection.createList(anyInt())).andAnswer(new IAnswer<DefaultNoSqlObject[]>() {
- @Override
- public DefaultNoSqlObject[] answer() throws Throwable {
- return new DefaultNoSqlObject[(Integer) getCurrentArguments()[0]];
- }
- });
- expect(this.connection.createObject()).andAnswer(new IAnswer<DefaultNoSqlObject>() {
- @Override
- public DefaultNoSqlObject answer() throws Throwable {
- return new DefaultNoSqlObject();
- }
- }).atLeastOnce();
- expect(event.getLevel()).andReturn(Level.DEBUG);
- expect(event.getLoggerName()).andReturn("com.foo.NoSQLDbTest.testWriteInternal02");
- expect(event.getMessage()).andReturn(message).times(2);
- expect(message.getFormattedMessage()).andReturn("Another cool message 02.");
- expect(event.getSource()).andReturn(new StackTraceElement("com.bar.Foo", "anotherMethod03", "Foo.java", 9));
- expect(event.getMarker()).andReturn(
- MarkerManager.getMarker("AnotherMarker").addParents(MarkerManager.getMarker("Parent1").addParents(MarkerManager.getMarker("GrandParent1")),
- MarkerManager.getMarker("Parent2")));
- expect(event.getThreadId()).andReturn(1L);
- expect(event.getThreadName()).andReturn("AnotherThread-B");
- expect(event.getThreadPriority()).andReturn(1);
- expect(event.getTimeMillis()).andReturn(987654321564L).times(2);
- expect(event.getThrown()).andReturn(exception2);
- expect(event.getContextMap()).andReturn(context);
- expect(event.getContextStack()).andReturn(stack);
- this.connection.insertObject(capture(capture));
- expectLastCall();
- replay(this.provider, this.connection, event, message);
+ final LogEvent event = Log4jLogEvent.newBuilder()
+ .setLevel(Level.DEBUG)
+ .setLoggerName("com.foo.NoSQLDbTest.testWriteInternal02")
+ .setMessage(message)
+ .setSource(new StackTraceElement("com.bar.Foo", "anotherMethod03", "Foo.java", 9))
+ .setMarker(MarkerManager.getMarker("AnotherMarker").addParents(
+ MarkerManager.getMarker("Parent1").addParents(MarkerManager.getMarker("GrandParent1")),
+ MarkerManager.getMarker("Parent2")))
+ .setThreadId(1L)
+ .setThreadName("AnotherThread-B")
+ .setThreadPriority(1)
+ .setTimeMillis(987654321564L)
+ .setThrown(exception2)
+ .setContextMap(context)
+ .setContextStack(stack)
+ .build();
manager.writeInternal(event);
+ then(connection).should().insertObject(captor.capture());
- final NoSqlObject<Map<String, Object>> inserted = capture.getValue();
+ final NoSqlObject<Map<String, Object>> inserted = captor.getValue();
assertNotNull("The inserted value should not be null.", inserted);
final Map<String, Object> object = inserted.unwrap();
assertNotNull("The unwrapped object should not be null.", object);
assertEquals("The level is not correct.", Level.DEBUG, object.get("level"));
assertEquals("The logger is not correct.", "com.foo.NoSQLDbTest.testWriteInternal02",
- object.get("loggerName"));
+ object.get("loggerName"));
assertEquals("The message is not correct.", "Another cool message 02.", object.get("message"));
assertEquals("The thread is not correct.", "AnotherThread-B", object.get("threadName"));
assertEquals("The millis is not correct.", 987654321564L, object.get("millis"));
@@ -494,12 +350,12 @@ public class NoSqlDatabaseManagerTest {
@SuppressWarnings("unchecked")
final List<Object> markerParents = (List<Object>) marker.get("parents");
assertEquals("The marker parents should contain two parents", 2, markerParents.size());
-
+
assertTrue("The marker parents[0] should be a map.", markerParents.get(0) instanceof Map);
@SuppressWarnings("unchecked")
final Map<String, Object> parent1 = (Map<String, Object>) markerParents.get(0);
assertEquals("The first marker parent name is not correct.", "Parent1", parent1.get("name"));
-
+
assertTrue("The marker parents[1] should be a map.", markerParents.get(1) instanceof Map);
@SuppressWarnings("unchecked")
final Map<String, Object> parent2 = (Map<String, Object>) markerParents.get(1);
@@ -510,7 +366,7 @@ public class NoSqlDatabaseManagerTest {
@SuppressWarnings("unchecked")
final List<Object> parent1Parents = (List<Object>) parent1.get("parents");
assertEquals("The parent1 parents should have only one parent", 1, parent1Parents.size());
-
+
assertTrue("The parent1Parents[0] should be a map.", parent1Parents.get(0) instanceof Map);
@SuppressWarnings("unchecked")
final Map<String, Object> parent1parent = (Map<String, Object>) parent1Parents.get(0);
@@ -526,17 +382,17 @@ public class NoSqlDatabaseManagerTest {
@SuppressWarnings("unchecked")
final List<Map<String, Object>> stackTrace = (List<Map<String, Object>>) thrown.get("stackTrace");
assertEquals("The thrown stack trace length is not correct.", exception2.getStackTrace().length,
- stackTrace.size());
+ stackTrace.size());
for (int i = 0; i < exception2.getStackTrace().length; i++) {
final StackTraceElement e1 = exception2.getStackTrace()[i];
final Map<String, Object> e2 = stackTrace.get(i);
assertEquals("Element class name [" + i + "] is not correct.", e1.getClassName(), e2.get("className"));
assertEquals("Element method name [" + i + "] is not correct.", e1.getMethodName(),
- e2.get("methodName"));
+ e2.get("methodName"));
assertEquals("Element file name [" + i + "] is not correct.", e1.getFileName(), e2.get("fileName"));
assertEquals("Element line number [" + i + "] is not correct.", e1.getLineNumber(),
- e2.get("lineNumber"));
+ e2.get("lineNumber"));
}
assertTrue("The thrown cause should be a map.", thrown.get("cause") instanceof Map);
@SuppressWarnings("unchecked")
@@ -547,17 +403,17 @@ public class NoSqlDatabaseManagerTest {
@SuppressWarnings("unchecked")
final List<Map<String, Object>> causeStackTrace = (List<Map<String, Object>>) cause.get("stackTrace");
assertEquals("The cause stack trace length is not correct.", exception1.getStackTrace().length,
- causeStackTrace.size());
+ causeStackTrace.size());
for (int i = 0; i < exception1.getStackTrace().length; i++) {
final StackTraceElement e1 = exception1.getStackTrace()[i];
final Map<String, Object> e2 = causeStackTrace.get(i);
assertEquals("Element class name [" + i + "] is not correct.", e1.getClassName(), e2.get("className"));
assertEquals("Element method name [" + i + "] is not correct.", e1.getMethodName(),
- e2.get("methodName"));
+ e2.get("methodName"));
assertEquals("Element file name [" + i + "] is not correct.", e1.getFileName(), e2.get("fileName"));
assertEquals("Element line number [" + i + "] is not correct.", e1.getLineNumber(),
- e2.get("lineNumber"));
+ e2.get("lineNumber"));
}
assertNull("The cause should have no cause.", cause.get("cause"));
@@ -566,14 +422,6 @@ public class NoSqlDatabaseManagerTest {
assertTrue("The context stack should be list.", object.get("contextStack") instanceof List);
assertEquals("The context stack is not correct.", stack.asList(), object.get("contextStack"));
-
- verify(this.provider, this.connection, event, message);
- } finally {
- try {
- manager.close();
- } catch (final Throwable ignore) {
- /* */
- }
}
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-web/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-web/pom.xml b/log4j-web/pom.xml
index 22dd052..db78e15 100644
--- a/log4j-web/pom.xml
+++ b/log4j-web/pom.xml
@@ -69,8 +69,8 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
[07/50] [abbrv] logging-log4j2 git commit: Refactor magic strings.
Posted by mi...@apache.org.
Refactor magic strings.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/0e15ec3e
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/0e15ec3e
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/0e15ec3e
Branch: refs/heads/LOG4J2-1390
Commit: 0e15ec3e8b6ef68a34310b1b5aeb97a898960fd2
Parents: baea991
Author: Gary Gregory <gg...@apache.org>
Authored: Wed Sep 28 19:10:43 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Sep 28 19:10:43 2016 -0700
----------------------------------------------------------------------
.../apache/logging/log4j/simple/SimpleLoggerContext.java | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0e15ec3e/log4j-api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java b/log4j-api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java
index 3fe637f..fe460c6 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java
@@ -33,6 +33,10 @@ import org.apache.logging.log4j.util.PropertiesUtil;
*/
public class SimpleLoggerContext implements LoggerContext {
+ private static final String SYSTEM_OUT = "system.out";
+
+ private static final String SYSTEM_ERR = "system.err";
+
/** The default format to use when formatting dates */
protected static final String DEFAULT_DATE_TIME_FORMAT = "yyyy/MM/dd HH:mm:ss:SSS zzz";
@@ -75,11 +79,11 @@ public class SimpleLoggerContext implements LoggerContext {
dateTimeFormat = showDateTime ? props.getStringProperty(SimpleLoggerContext.SYSTEM_PREFIX + "dateTimeFormat",
DEFAULT_DATE_TIME_FORMAT) : null;
- final String fileName = props.getStringProperty(SYSTEM_PREFIX + "logFile", "system.err");
+ final String fileName = props.getStringProperty(SYSTEM_PREFIX + "logFile", SYSTEM_ERR);
PrintStream ps;
- if ("system.err".equalsIgnoreCase(fileName)) {
+ if (SYSTEM_ERR.equalsIgnoreCase(fileName)) {
ps = System.err;
- } else if ("system.out".equalsIgnoreCase(fileName)) {
+ } else if (SYSTEM_OUT.equalsIgnoreCase(fileName)) {
ps = System.out;
} else {
try {
[32/50] [abbrv] logging-log4j2 git commit: Merge branch 'master' into
LOG4J2-1623
Posted by mi...@apache.org.
Merge branch 'master' into LOG4J2-1623
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/3064471e
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/3064471e
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/3064471e
Branch: refs/heads/LOG4J2-1390
Commit: 3064471eaa1b7f7d3c5e38349281e1ccdd054cfa
Parents: c92c327 2da9dfa
Author: Mikael St�ldal <mi...@magine.com>
Authored: Thu Oct 6 13:29:28 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Thu Oct 6 13:29:28 2016 +0200
----------------------------------------------------------------------
log4j-bom/pom.xml | 4 ----
.../main/java/org/apache/logging/log4j/core/LoggerContext.java | 2 +-
.../java/org/apache/logging/log4j/core/util/CyclicBuffer.java | 4 ++--
.../org/apache/logging/log4j/core/util/ExecutorServices.java | 4 ++--
src/site/site.xml | 1 +
src/site/xdoc/javadoc.xml | 4 ++++
6 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3064471e/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
----------------------------------------------------------------------
[22/50] [abbrv] logging-log4j2 git commit: LOG4J2-1623 Configurable
JVM shutdown hook timeout
Posted by mi...@apache.org.
LOG4J2-1623 Configurable JVM shutdown hook timeout
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/705e2725
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/705e2725
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/705e2725
Branch: refs/heads/LOG4J2-1390
Commit: 705e27253ca14cdf0e50039cada041065e308aee
Parents: 3176c96
Author: Mikael St�ldal <mi...@magine.com>
Authored: Mon Oct 3 18:54:27 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Mon Oct 3 18:54:27 2016 +0200
----------------------------------------------------------------------
.../logging/log4j/core/LoggerContext.java | 9 ++--
.../core/config/AbstractConfiguration.java | 10 +++++
.../log4j/core/config/Configuration.java | 2 +
.../builder/api/ConfigurationBuilder.java | 7 ++++
.../config/builder/impl/BuiltConfiguration.java | 4 ++
.../impl/DefaultConfigurationBuilder.java | 14 +++++++
.../composite/CompositeConfiguration.java | 2 +
.../core/config/json/JsonConfiguration.java | 9 ++--
.../PropertiesConfigurationBuilder.java | 3 ++
.../log4j/core/config/xml/XmlConfiguration.java | 3 +-
.../core/ShutdownTimeoutConfigurationTest.java | 44 ++++++++++++++++++++
.../builder/ConfigurationBuilderTest.java | 5 ++-
.../resources/log4j-test-shutdownTimeout.xml | 38 +++++++++++++++++
src/changes/changes.xml | 5 +++
src/site/xdoc/manual/configuration.xml.vm | 8 +++-
15 files changed, 151 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
index 7e13963..c964965 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
@@ -16,8 +16,6 @@
*/
package org.apache.logging.log4j.core;
-import static org.apache.logging.log4j.core.util.ShutdownCallbackRegistry.SHUTDOWN_HOOK_MARKER;
-
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
@@ -38,7 +36,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.ConfigurationFactory;
import org.apache.logging.log4j.core.config.ConfigurationListener;
-import org.apache.logging.log4j.core.config.ConfigurationSource; // SUPPRESS CHECKSTYLE
+import org.apache.logging.log4j.core.config.ConfigurationSource;
import org.apache.logging.log4j.core.config.DefaultConfiguration;
import org.apache.logging.log4j.core.config.NullConfiguration;
import org.apache.logging.log4j.core.config.Reconfigurable;
@@ -56,6 +54,8 @@ import org.apache.logging.log4j.spi.LoggerRegistry;
import org.apache.logging.log4j.spi.Terminable;
import org.apache.logging.log4j.util.PropertiesUtil;
+import static org.apache.logging.log4j.core.util.ShutdownCallbackRegistry.SHUTDOWN_HOOK_MARKER;
+
/**
* The LoggerContext is the anchor for the logging system. It maintains a list of all the loggers requested by
* applications and a reference to the Configuration. The Configuration will contain the configured loggers, appenders,
@@ -265,6 +265,7 @@ public class LoggerContext extends AbstractLifeCycle
if (factory instanceof ShutdownCallbackRegistry) {
LOGGER.debug(SHUTDOWN_HOOK_MARKER, "Shutdown hook enabled. Registering a new one.");
try {
+ final long shutdownTimeoutMillis = this.configuration.getShutdownTimeoutMillis();
this.shutdownCallback = ((ShutdownCallbackRegistry) factory).addShutdownCallback(new Runnable() {
@Override
public void run() {
@@ -272,7 +273,7 @@ public class LoggerContext extends AbstractLifeCycle
final LoggerContext context = LoggerContext.this;
LOGGER.debug(SHUTDOWN_HOOK_MARKER, "Stopping LoggerContext[name={}, {}]",
context.getName(), context);
- context.stop();
+ context.stop(shutdownTimeoutMillis, TimeUnit.MILLISECONDS);
}
@Override
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
index c740b8c..3a6a58e 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
@@ -102,6 +102,11 @@ public abstract class AbstractConfiguration extends AbstractFilterable implement
protected boolean isShutdownHookEnabled = true;
/**
+ * Shutdown timeout in milliseconds.
+ */
+ protected long shutdownTimeoutMillis = 0;
+
+ /**
* The Script manager.
*/
protected ScriptManager scriptManager;
@@ -395,6 +400,11 @@ public abstract class AbstractConfiguration extends AbstractFilterable implement
return isShutdownHookEnabled;
}
+ @Override
+ public long getShutdownTimeoutMillis() {
+ return shutdownTimeoutMillis;
+ }
+
public void setup() {
// default does nothing, subclasses do work.
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
index 1a55b48..95e6edc 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configuration.java
@@ -128,6 +128,8 @@ public interface Configuration extends Filterable {
boolean isShutdownHookEnabled();
+ long getShutdownTimeoutMillis();
+
ConfigurationScheduler getScheduler();
/**
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java
index 4dc9b69..b115651 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java
@@ -18,6 +18,7 @@ package org.apache.logging.log4j.core.config.builder.api;
import java.io.IOException;
import java.io.OutputStream;
+import java.util.concurrent.TimeUnit;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.Filter;
@@ -367,6 +368,12 @@ public interface ConfigurationBuilder<T extends Configuration> extends Builder<T
*/
ConfigurationBuilder<T> setShutdownHook(String flag);
+ /**
+ * Specifies how long time appenders and other plugins will get to shutdown when the JVM shuts down.
+ * Default is zero. (Not used if {@link #setShutdownHook(String)} is set to "disable".)
+ * @return this builder instance.
+ */
+ ConfigurationBuilder<T> setShutdownTimeout(long timeout, TimeUnit timeUnit);
/**
* Sets the level of the StatusLogger.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/BuiltConfiguration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/BuiltConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/BuiltConfiguration.java
index aa7761c..c241dfb 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/BuiltConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/BuiltConfiguration.java
@@ -147,6 +147,10 @@ public class BuiltConfiguration extends AbstractConfiguration {
isShutdownHookEnabled = !"disable".equalsIgnoreCase(flag);
}
+ public void setShutdownTimeoutMillis(long shutdownTimeoutMillis) {
+ this.shutdownTimeoutMillis = shutdownTimeoutMillis;
+ }
+
public void setMonitorInterval(final int intervalSeconds) {
if (this instanceof Reconfigurable && intervalSeconds > 0) {
final ConfigurationSource configSource = getConfigurationSource();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java
index d8531d6..183094d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/impl/DefaultConfigurationBuilder.java
@@ -22,6 +22,7 @@ import java.io.StringWriter;
import java.lang.reflect.Constructor;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
@@ -71,6 +72,7 @@ public class DefaultConfigurationBuilder<T extends BuiltConfiguration> implement
private String destination;
private String packages;
private String shutdownFlag;
+ private long shutdownTimeoutMillis;
private String advertiser;
private LoggerContext loggerContext;
private String name;
@@ -186,6 +188,9 @@ public class DefaultConfigurationBuilder<T extends BuiltConfiguration> implement
if (shutdownFlag != null) {
configuration.setShutdownHook(shutdownFlag);
}
+ if (shutdownTimeoutMillis > 0) {
+ configuration.setShutdownTimeoutMillis(shutdownTimeoutMillis);
+ }
if (advertiser != null) {
configuration.createAdvertiser(advertiser, source);
}
@@ -249,6 +254,9 @@ public class DefaultConfigurationBuilder<T extends BuiltConfiguration> implement
if (shutdownFlag != null) {
xmlWriter.writeAttribute("shutdownHook", shutdownFlag);
}
+ if (shutdownTimeoutMillis > 0) {
+ xmlWriter.writeAttribute("shutdownTimeout", String.valueOf(shutdownTimeoutMillis));
+ }
if (advertiser != null) {
xmlWriter.writeAttribute("advertiser", advertiser);
}
@@ -514,6 +522,12 @@ public class DefaultConfigurationBuilder<T extends BuiltConfiguration> implement
}
@Override
+ public ConfigurationBuilder<T> setShutdownTimeout(final long timeout, final TimeUnit timeUnit) {
+ this.shutdownTimeoutMillis = timeUnit.toMillis(timeout);
+ return this;
+ }
+
+ @Override
public ConfigurationBuilder<T> setStatusLevel(final Level level) {
this.level = level;
return this;
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/log4j-core/src/main/java/org/apache/logging/log4j/core/config/composite/CompositeConfiguration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/composite/CompositeConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/composite/CompositeConfiguration.java
index fa941d7..e38c62b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/composite/CompositeConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/composite/CompositeConfiguration.java
@@ -87,6 +87,8 @@ public class CompositeConfiguration extends AbstractConfiguration implements Rec
statusConfig.withDestination(value);
} else if ("shutdownHook".equalsIgnoreCase(key)) {
isShutdownHookEnabled = !"disable".equalsIgnoreCase(value);
+ } else if ("shutdownTimeout".equalsIgnoreCase(key)) {
+ shutdownTimeoutMillis = Long.parseLong(value);
} else if ("verbose".equalsIgnoreCase(key)) {
statusConfig.withVerbosity(value);
} else if ("packages".equalsIgnoreCase(key)) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/log4j-core/src/main/java/org/apache/logging/log4j/core/config/json/JsonConfiguration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/json/JsonConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/json/JsonConfiguration.java
index 497496a..5b38dfb 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/json/JsonConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/json/JsonConfiguration.java
@@ -26,6 +26,9 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.AbstractConfiguration;
import org.apache.logging.log4j.core.config.Configuration;
@@ -40,10 +43,6 @@ import org.apache.logging.log4j.core.config.status.StatusConfiguration;
import org.apache.logging.log4j.core.util.FileWatcher;
import org.apache.logging.log4j.core.util.Patterns;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
/**
* Creates a Node hierarchy from a JSON file.
*/
@@ -81,6 +80,8 @@ public class JsonConfiguration extends AbstractConfiguration implements Reconfig
statusConfig.withDestination(value);
} else if ("shutdownHook".equalsIgnoreCase(key)) {
isShutdownHookEnabled = !"disable".equalsIgnoreCase(value);
+ } else if ("shutdownTimeout".equalsIgnoreCase(key)) {
+ shutdownTimeoutMillis = Long.parseLong(value);
} else if ("verbose".equalsIgnoreCase(entry.getKey())) {
statusConfig.withVerbosity(value);
} else if ("packages".equalsIgnoreCase(key)) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java
index a4362b7..3d24a9b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/properties/PropertiesConfigurationBuilder.java
@@ -19,6 +19,7 @@ package org.apache.logging.log4j.core.config.properties;
import java.util.Map;
import java.util.Properties;
+import java.util.concurrent.TimeUnit;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.Appender;
@@ -54,6 +55,7 @@ public class PropertiesConfigurationBuilder extends ConfigurationBuilderFactory
private static final String ADVERTISER_KEY = "advertiser";
private static final String STATUS_KEY = "status";
private static final String SHUTDOWN_HOOK = "shutdownHook";
+ private static final String SHUTDOWN_TIMEOUT = "shutdownTimeout";
private static final String VERBOSE = "verbose";
private static final String DEST = "dest";
private static final String PACKAGES = "packages";
@@ -89,6 +91,7 @@ public class PropertiesConfigurationBuilder extends ConfigurationBuilderFactory
builder
.setStatusLevel(Level.toLevel(rootProperties.getProperty(STATUS_KEY), Level.ERROR))
.setShutdownHook(rootProperties.getProperty(SHUTDOWN_HOOK))
+ .setShutdownTimeout(Long.parseLong(rootProperties.getProperty(SHUTDOWN_TIMEOUT, "0")), TimeUnit.MILLISECONDS)
.setVerbosity(rootProperties.getProperty(VERBOSE))
.setDestination(rootProperties.getProperty(DEST))
.setPackages(rootProperties.getProperty(PACKAGES))
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java
index 2608552..51f31d4 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java
@@ -24,7 +24,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
-
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -120,6 +119,8 @@ public class XmlConfiguration extends AbstractConfiguration implements Reconfigu
statusConfig.withDestination(value);
} else if ("shutdownHook".equalsIgnoreCase(key)) {
isShutdownHookEnabled = !"disable".equalsIgnoreCase(value);
+ } else if ("shutdownTimeout".equalsIgnoreCase(key)) {
+ shutdownTimeoutMillis = Long.parseLong(value);
} else if ("verbose".equalsIgnoreCase(key)) {
statusConfig.withVerbosity(value);
} else if ("packages".equalsIgnoreCase(key)) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownTimeoutConfigurationTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownTimeoutConfigurationTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownTimeoutConfigurationTest.java
new file mode 100644
index 0000000..5e0734c
--- /dev/null
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownTimeoutConfigurationTest.java
@@ -0,0 +1,44 @@
+/*
+ * 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;
+
+import org.apache.logging.log4j.core.config.Configuration;
+import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.junit.ClassRule;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ *
+ */
+public class ShutdownTimeoutConfigurationTest {
+
+ private static final String CONFIG = "log4j-test-shutdownTimeout.xml";
+
+ @ClassRule
+ public static LoggerContextRule context = new LoggerContextRule(CONFIG);
+
+ @Test
+ public void testShutdownFlag() {
+ final Configuration config = context.getConfiguration();
+ assertNotNull("No configuration", config);
+ assertEquals(5000, config.getShutdownTimeoutMillis());
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/log4j-core/src/test/java/org/apache/logging/log4j/core/config/builder/ConfigurationBuilderTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/builder/ConfigurationBuilderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/builder/ConfigurationBuilderTest.java
index 2d48605..431ac01 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/config/builder/ConfigurationBuilderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/config/builder/ConfigurationBuilderTest.java
@@ -16,6 +16,8 @@
*/
package org.apache.logging.log4j.core.config.builder;
+import java.util.concurrent.TimeUnit;
+
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.appender.ConsoleAppender;
@@ -36,6 +38,7 @@ public class ConfigurationBuilderTest {
private void addTestFixtures(final String name, final ConfigurationBuilder<BuiltConfiguration> builder) {
builder.setConfigurationName(name);
builder.setStatusLevel(Level.ERROR);
+ builder.setShutdownTimeout(5000, TimeUnit.MILLISECONDS);
builder.add(builder.newScriptFile("target/test-classes/scripts/filter.groovy").addIsWatched(true));
builder.add(builder.newFilter("ThresholdFilter", Filter.Result.ACCEPT, Filter.Result.NEUTRAL)
.addAttribute("level", Level.DEBUG));
@@ -56,7 +59,7 @@ public class ConfigurationBuilderTest {
private final static String expectedXml =
"<?xml version='1.0' encoding='UTF-8'?>" + EOL +
- "<Configuration name=\"config name\" status=\"ERROR\" packages=\"foo,bar\">" + EOL +
+ "<Configuration name=\"config name\" status=\"ERROR\" packages=\"foo,bar\" shutdownTimeout=\"5000\">" + EOL +
INDENT + "<Properties>" + EOL +
INDENT + INDENT + "<Property name=\"MyKey\">MyValue</Property>" + EOL +
INDENT + "</Properties>" + EOL +
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/log4j-core/src/test/resources/log4j-test-shutdownTimeout.xml
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/resources/log4j-test-shutdownTimeout.xml b/log4j-core/src/test/resources/log4j-test-shutdownTimeout.xml
new file mode 100644
index 0000000..19b25c9
--- /dev/null
+++ b/log4j-core/src/test/resources/log4j-test-shutdownTimeout.xml
@@ -0,0 +1,38 @@
+<?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="OFF" name="XMLConfigTest" monitorInterval="5" shutdownTimeout="5000">
+ <Appenders>
+ <Console name="STDOUT">
+ <PatternLayout pattern="%m MDC%X%n"/>
+ </Console>
+ <List name="List">
+ </List>
+ </Appenders>
+
+ <Loggers>
+ <Logger name="org.apache.logging.log4j.test1" level="debug" additivity="false">
+ <AppenderRef ref="STDOUT"/>
+ </Logger>>
+
+ <Root level="trace">
+ <AppenderRef ref="List"/>
+ </Root>
+ </Loggers>
+
+</Configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index cd2f379..6bd144c 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -23,6 +23,11 @@
<title>Changes</title>
</properties>
<body>
+ <release version="2.7.1" date="2016-XX-XX" description="GA Release 2.7.1">
+ <action issue="LOG4J2-1623" dev="mikes" type="fix">
+ Configurable JVM shutdown hook timeout.
+ </action>
+ </release>
<release version="2.7" date="2016-10-02" description="GA Release 2.7">
<action issue="LOG4J2-1618" dev="rpopma" type="fix" due-to="Raman Gupta">
Fixed ClassCastException when using JUL logging during shutdown.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/705e2725/src/site/xdoc/manual/configuration.xml.vm
----------------------------------------------------------------------
diff --git a/src/site/xdoc/manual/configuration.xml.vm b/src/site/xdoc/manual/configuration.xml.vm
index 60419a4..acd41fd 100644
--- a/src/site/xdoc/manual/configuration.xml.vm
+++ b/src/site/xdoc/manual/configuration.xml.vm
@@ -408,6 +408,10 @@ public class Bar {
shutdown hook is enabled by default but may be disabled by setting this attribute to "disable"</td>
</tr>
<tr>
+ <td>shutdownTimeout</td>
+ <td>Specifies how many milliseconds appenders and other plugins will get to shutdown when the JVM shuts down.
+ Default is zero. (Not used if <tt>shutdownHook</tt> is set to "disable".)</td>
+ <tr>
<td>status</td>
<td>The level of internal Log4j events that should be logged to the console.
Valid values for this attribute are "trace", "debug", "info", "warn", "error" and "fatal".
@@ -841,8 +845,8 @@ public class Bar {
</p>
<p>
Properties configuration files support the advertiser, monitorInterval, name, packages, shutdownHook,
- status, verbose, and dest attrbutes. See <a href="#ConfigurationSyntax">Configuration Syntax</a> for the
- definitions of these attributes.
+ shutdownTimeout, status, verbose, and dest attrbutes. See <a href="#ConfigurationSyntax">Configuration Syntax</a>
+ for the definitions of these attributes.
</p>
<pre class="prettyprint linenums">
status = error
[44/50] [abbrv] logging-log4j2 git commit: [LOG4J2-1644] Inefficient
locking in AbstractLoggerAdapter.
Posted by mi...@apache.org.
[LOG4J2-1644] Inefficient locking in AbstractLoggerAdapter.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/7114c91c
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/7114c91c
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/7114c91c
Branch: refs/heads/LOG4J2-1390
Commit: 7114c91cc6e974cb5a7627dd9646143143366c81
Parents: 22369cc
Author: Tim Gokcen <he...@gmail.com>
Authored: Fri Oct 21 13:02:59 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Fri Oct 21 13:02:59 2016 -0700
----------------------------------------------------------------------
.../log4j/spi/AbstractLoggerAdapter.java | 31 ++++-
.../logging/log4j/spi/LoggerAdapterTest.java | 126 +++++++++++++++++++
src/changes/changes.xml | 3 +
3 files changed, 154 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7114c91c/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerAdapter.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerAdapter.java b/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerAdapter.java
index 3c6c84f..33c8745 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerAdapter.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerAdapter.java
@@ -20,6 +20,8 @@ import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.util.LoaderUtil;
@@ -37,6 +39,8 @@ public abstract class AbstractLoggerAdapter<L> implements LoggerAdapter<L> {
*/
protected final Map<LoggerContext, ConcurrentMap<String, L>> registry = new WeakHashMap<>();
+ private final ReadWriteLock lock = new ReentrantReadWriteLock (true);
+
@Override
public L getLogger(final String name) {
final LoggerContext context = getContext();
@@ -56,13 +60,28 @@ public abstract class AbstractLoggerAdapter<L> implements LoggerAdapter<L> {
* @return the map of loggers for the given LoggerContext
*/
public ConcurrentMap<String, L> getLoggersInContext(final LoggerContext context) {
- synchronized (registry) {
- ConcurrentMap<String, L> loggers = registry.get(context);
- if (loggers == null) {
- loggers = new ConcurrentHashMap<>();
- registry.put(context, loggers);
- }
+ ConcurrentMap<String, L> loggers;
+ lock.readLock ().lock ();
+ try {
+ loggers = registry.get (context);
+ } finally {
+ lock.readLock ().unlock ();
+ }
+
+ if (loggers != null) {
return loggers;
+ } else {
+ lock.writeLock ().lock ();
+ try {
+ loggers = registry.get (context);
+ if (loggers == null) {
+ loggers = new ConcurrentHashMap<> ();
+ registry.put (context, loggers);
+ }
+ return loggers;
+ } finally {
+ lock.writeLock ().unlock ();
+ }
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7114c91c/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerAdapterTest.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerAdapterTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerAdapterTest.java
new file mode 100644
index 0000000..b04fe6f
--- /dev/null
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerAdapterTest.java
@@ -0,0 +1,126 @@
+/*
+ * 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.spi;
+
+import org.apache.logging.log4j.simple.SimpleLoggerContext;
+import org.junit.Test;
+
+import java.util.Map;
+import java.util.concurrent.CountDownLatch;
+import java.util.logging.Logger;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+
+/**
+ * Created by Pavel.Sivolobtchik@uxpsystems.com on 2016-10-19.
+ */
+public class LoggerAdapterTest {
+
+ private class RunnableThreadTest implements Runnable {
+ private AbstractLoggerAdapter<Logger> adapter;
+ private LoggerContext context;
+ private CountDownLatch doneSignal;
+ private int index;
+ private Map<String, Logger> resultMap;
+
+ private CountDownLatch startSignal;
+
+ public RunnableThreadTest(int index, TestLoggerAdapter adapter, LoggerContext context,
+ CountDownLatch startSignal, CountDownLatch doneSignal) {
+ this.adapter = adapter;
+ this.context = context;
+ this.startSignal = startSignal;
+ this.doneSignal = doneSignal;
+ this.index = index;
+ }
+
+ public Map<String, Logger> getResultMap() {
+ return resultMap;
+ }
+
+ @Override
+ public void run() {
+ try {
+ startSignal.await();
+ resultMap = adapter.getLoggersInContext(context);
+ resultMap.put(String.valueOf(index), new TestLogger());
+ doneSignal.countDown();
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ }
+
+ private static class TestLogger extends Logger {
+ public TestLogger() {
+ super("test", null);
+ }
+ }
+
+ private static class TestLoggerAdapter extends AbstractLoggerAdapter<Logger> {
+
+ @Override
+ protected LoggerContext getContext() {
+ return null;
+ }
+
+ @Override
+ protected Logger newLogger(String name, LoggerContext context) {
+ return null;
+ }
+ }
+
+ /**
+ * Testing synchronization in the getLoggersInContext() method
+ */
+ @Test
+ public synchronized void testGetLoggersInContextSynch() throws Exception {
+ TestLoggerAdapter adapter = new TestLoggerAdapter();
+
+ int num = 500;
+
+ CountDownLatch startSignal = new CountDownLatch(1);
+ CountDownLatch doneSignal = new CountDownLatch(num);
+
+ RunnableThreadTest[] instances = new RunnableThreadTest[num];
+ LoggerContext lastUsedContext = null;
+ for (int i = 0; i < num; i++) {
+ if (i % 2 == 0) {
+ //every other time create a new context
+ lastUsedContext = new SimpleLoggerContext();
+ }
+ RunnableThreadTest runnable = new RunnableThreadTest(i, adapter, lastUsedContext, startSignal, doneSignal);
+ Thread thread = new Thread(runnable);
+ thread.start();
+ instances[i] = runnable;
+ }
+
+ startSignal.countDown();
+ doneSignal.await();
+
+ for (int i = 0; i < num; i = i + 2) {
+ //maps for the same context should be the same instance
+ Map<String, Logger> resultMap1 = instances[i].getResultMap();
+ Map<String, Logger> resultMap2 = instances[i + 1].getResultMap();
+ assertSame("not the same map for instances" + i + " and " + (i + 1) + ":", resultMap1, resultMap2);
+ assertEquals(2, resultMap1.size());
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7114c91c/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 2922511..1c63572 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -33,6 +33,9 @@
<action issue="LOG4J2-1639" dev="ggregory" type="fix" due-to="Sridhar Gopinath">
Fix MemoryMappedFileAppender.createAppender() Javadoc for immediateFlush.
</action>
+ <action issue="LOG4J2-1644" dev="ggregory" type="update" due-to="Tim Gokcen, Pavel Sivolobtchik">
+ Inefficient locking in AbstractLoggerAdapter.
+ </action>
<action issue="LOG4J2-1641" dev="ggregory" type="update">
Update JeroMQ from 0.3.5 to 0.3.6.
</action>
[47/50] [abbrv] logging-log4j2 git commit: Migrate unit tests to
Mockito 2.x
Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletContainerInitializerTest.java
----------------------------------------------------------------------
diff --git a/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletContainerInitializerTest.java b/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletContainerInitializerTest.java
index a4e6a6c..0cd3988 100644
--- a/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletContainerInitializerTest.java
+++ b/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletContainerInitializerTest.java
@@ -24,156 +24,125 @@ import javax.servlet.FilterRegistration;
import javax.servlet.ServletContext;
import org.apache.logging.log4j.util.Strings;
-import org.easymock.Capture;
-import org.easymock.EasyMock;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
-import static org.easymock.EasyMock.capture;
-import static org.easymock.EasyMock.createStrictMock;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
import static org.junit.Assert.*;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.BDDMockito.then;
+import static org.mockito.BDDMockito.willThrow;
+import static org.mockito.Mockito.mock;
+@RunWith(MockitoJUnitRunner.class)
public class Log4jServletContainerInitializerTest {
+ @Mock
private ServletContext servletContext;
+ @Mock
private Log4jWebLifeCycle initializer;
+ @Captor
+ private ArgumentCaptor<Class<? extends Filter>> filterCaptor;
+ @Captor
+ private ArgumentCaptor<EventListener> listenerCaptor;
private Log4jServletContainerInitializer containerInitializer;
@Before
public void setUp() {
- this.servletContext = createStrictMock(ServletContext.class);
- this.initializer = createStrictMock(Log4jWebLifeCycle.class);
-
this.containerInitializer = new Log4jServletContainerInitializer();
}
- @After
- public void tearDown() {
- verify(this.servletContext, this.initializer);
- }
-
@Test
public void testOnStartupWithServletVersion2_x() throws Exception {
- expect(this.servletContext.getMajorVersion()).andReturn(2);
-
- replay(this.servletContext, this.initializer);
+ given(servletContext.getMajorVersion()).willReturn(2);
this.containerInitializer.onStartup(null, this.servletContext);
}
@Test
public void testOnStartupWithServletVersion3_xEffectiveVersion2_x() throws Exception {
- expect(this.servletContext.getMajorVersion()).andReturn(3);
- expect(this.servletContext.getEffectiveMajorVersion()).andReturn(2);
-
- replay(this.servletContext, this.initializer);
+ given(servletContext.getMajorVersion()).willReturn(3);
+ given(servletContext.getEffectiveMajorVersion()).willReturn(2);
this.containerInitializer.onStartup(null, this.servletContext);
}
@Test
public void testOnStartupWithServletVersion3_xEffectiveVersion3_xDisabledTrue() throws Exception {
- expect(this.servletContext.getMajorVersion()).andReturn(3);
- expect(this.servletContext.getEffectiveMajorVersion()).andReturn(3);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.IS_LOG4J_AUTO_INITIALIZATION_DISABLED))
- .andReturn("true");
-
- replay(this.servletContext, this.initializer);
+ given(servletContext.getMajorVersion()).willReturn(3);
+ given(servletContext.getEffectiveMajorVersion()).willReturn(3);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.IS_LOG4J_AUTO_INITIALIZATION_DISABLED))).willReturn(
+ "true");
this.containerInitializer.onStartup(null, this.servletContext);
}
@Test
public void testOnStartupWithServletVersion3_xEffectiveVersion3_xDisabledTRUE() throws Exception {
- expect(this.servletContext.getMajorVersion()).andReturn(3);
- expect(this.servletContext.getEffectiveMajorVersion()).andReturn(3);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.IS_LOG4J_AUTO_INITIALIZATION_DISABLED))
- .andReturn("TRUE");
-
- replay(this.servletContext, this.initializer);
+ given(servletContext.getMajorVersion()).willReturn(3);
+ given(servletContext.getEffectiveMajorVersion()).willReturn(3);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.IS_LOG4J_AUTO_INITIALIZATION_DISABLED))).willReturn(
+ "TRUE");
this.containerInitializer.onStartup(null, this.servletContext);
}
@Test
public void testOnStartupWithServletVersion3_xEffectiveVersion3_x() throws Exception {
- final FilterRegistration.Dynamic registration = createStrictMock(FilterRegistration.Dynamic.class);
-
- final Capture<EventListener> listenerCapture = EasyMock.newCapture();
- final Capture<Class<? extends Filter>> filterCapture = EasyMock.newCapture();
-
- expect(this.servletContext.getMajorVersion()).andReturn(3);
- expect(this.servletContext.getEffectiveMajorVersion()).andReturn(3);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.IS_LOG4J_AUTO_INITIALIZATION_DISABLED))
- .andReturn(null);
- expect(this.servletContext.addFilter(eq("log4jServletFilter"), capture(filterCapture))).andReturn(registration);
- expect(this.servletContext.getAttribute(Log4jWebSupport.SUPPORT_ATTRIBUTE)).andReturn(this.initializer);
- this.initializer.start();
- expectLastCall();
- this.initializer.setLoggerContext();
- expectLastCall();
- this.servletContext.addListener(capture(listenerCapture));
- expectLastCall();
- registration.setAsyncSupported(true);
- expectLastCall();
- registration.addMappingForUrlPatterns(eq(EnumSet.allOf(DispatcherType.class)), eq(false), eq("/*"));
- expectLastCall();
-
- replay(this.servletContext, this.initializer, registration);
-
- this.containerInitializer.onStartup(null, this.servletContext);
-
- assertNotNull("The listener should not be null.", listenerCapture.getValue());
+ final FilterRegistration.Dynamic registration = mock(FilterRegistration.Dynamic.class);
+ given(servletContext.getMajorVersion()).willReturn(3);
+ given(servletContext.getEffectiveMajorVersion()).willReturn(3);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.IS_LOG4J_AUTO_INITIALIZATION_DISABLED))).willReturn(
+ null);
+ given(servletContext.addFilter(eq("log4jServletFilter"), filterCaptor.capture())).willReturn(registration);
+ given(servletContext.getAttribute(Log4jWebSupport.SUPPORT_ATTRIBUTE)).willReturn(initializer);
+
+ containerInitializer.onStartup(null, servletContext);
+
+ then(initializer).should().start();
+ then(initializer).should().setLoggerContext();
+ then(servletContext).should().addListener(listenerCaptor.capture());
+ then(registration).should().setAsyncSupported(eq(true));
+ then(registration).should().addMappingForUrlPatterns(eq(EnumSet.allOf(DispatcherType.class)), eq(false), eq("/*"));
+
+ assertNotNull("The listener should not be null.", listenerCaptor.getValue());
assertSame("The listener is not correct.", Log4jServletContextListener.class,
- listenerCapture.getValue().getClass());
-
- assertNotNull("The filter should not be null.", filterCapture.getValue());
- assertSame("The filter is not correct.", Log4jServletFilter.class, filterCapture.getValue());
+ listenerCaptor.getValue().getClass());
- verify(registration);
+ assertNotNull("The filter should not be null.", filterCaptor.getValue());
+ assertSame("The filter is not correct.", Log4jServletFilter.class, filterCaptor.getValue());
}
@Test
public void testOnStartupCanceledDueToPreExistingFilter() throws Exception {
- final Capture<Class<? extends Filter>> filterCapture = EasyMock.newCapture();
-
- expect(this.servletContext.getMajorVersion()).andReturn(3);
- expect(this.servletContext.getEffectiveMajorVersion()).andReturn(3);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.IS_LOG4J_AUTO_INITIALIZATION_DISABLED))
- .andReturn("false");
- expect(this.servletContext.addFilter(eq("log4jServletFilter"), capture(filterCapture))).andReturn(null);
-
- replay(this.servletContext, this.initializer);
+ given(servletContext.getMajorVersion()).willReturn(3);
+ given(servletContext.getEffectiveMajorVersion()).willReturn(3);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.IS_LOG4J_AUTO_INITIALIZATION_DISABLED))).willReturn(
+ "false");
+ given(servletContext.addFilter(eq("log4jServletFilter"), filterCaptor.capture())).willReturn(null);
this.containerInitializer.onStartup(null, this.servletContext);
- assertNotNull("The filter should not be null.", filterCapture.getValue());
- assertSame("The filter is not correct.", Log4jServletFilter.class, filterCapture.getValue());
+ assertNotNull("The filter should not be null.", filterCaptor.getValue());
+ assertSame("The filter is not correct.", Log4jServletFilter.class, filterCaptor.getValue());
}
@Test
public void testOnStartupFailedDueToInitializerFailure() throws Exception {
- final FilterRegistration.Dynamic registration = createStrictMock(FilterRegistration.Dynamic.class);
-
- final Capture<Class<? extends Filter>> filterCapture = EasyMock.newCapture();
+ final FilterRegistration.Dynamic registration = mock(FilterRegistration.Dynamic.class);
final IllegalStateException exception = new IllegalStateException(Strings.EMPTY);
-
- expect(this.servletContext.getMajorVersion()).andReturn(3);
- expect(this.servletContext.getEffectiveMajorVersion()).andReturn(3);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.IS_LOG4J_AUTO_INITIALIZATION_DISABLED))
- .andReturn("balderdash");
- expect(this.servletContext.addFilter(eq("log4jServletFilter"), capture(filterCapture))).andReturn(registration);
- expect(this.servletContext.getAttribute(Log4jWebSupport.SUPPORT_ATTRIBUTE)).andReturn(this.initializer);
- this.initializer.start();
- expectLastCall().andThrow(exception);
-
- replay(this.servletContext, this.initializer, registration);
+ given(servletContext.getMajorVersion()).willReturn(3);
+ given(servletContext.getEffectiveMajorVersion()).willReturn(3);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.IS_LOG4J_AUTO_INITIALIZATION_DISABLED))).willReturn(
+ "balderdash");
+ given(servletContext.addFilter(eq("log4jServletFilter"), filterCaptor.capture())).willReturn(registration);
+ given(servletContext.getAttribute(Log4jWebSupport.SUPPORT_ATTRIBUTE)).willReturn(initializer);
+ willThrow(exception).given(initializer).start();
try {
this.containerInitializer.onStartup(null, this.servletContext);
@@ -182,9 +151,8 @@ public class Log4jServletContainerInitializerTest {
assertSame("The exception is not correct.", exception, e);
}
- assertNotNull("The filter should not be null.", filterCapture.getValue());
- assertSame("The filter is not correct.", Log4jServletFilter.class, filterCapture.getValue());
-
- verify(registration);
+ then(initializer).should().start();
+ assertNotNull("The filter should not be null.", filterCaptor.getValue());
+ assertSame("The filter is not correct.", Log4jServletFilter.class, filterCaptor.getValue());
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletContextListenerTest.java
----------------------------------------------------------------------
diff --git a/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletContextListenerTest.java b/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletContextListenerTest.java
index a1d90ff..7be7b9c 100644
--- a/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletContextListenerTest.java
+++ b/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletContextListenerTest.java
@@ -20,73 +20,51 @@ import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import org.apache.logging.log4j.util.Strings;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
-import static org.easymock.EasyMock.createStrictMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.reset;
-import static org.easymock.EasyMock.verify;
import static org.junit.Assert.*;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.BDDMockito.then;
+import static org.mockito.BDDMockito.willThrow;
+@RunWith(MockitoJUnitRunner.class)
public class Log4jServletContextListenerTest {
+ @Mock
private ServletContextEvent event;
+ @Mock
private ServletContext servletContext;
+ @Mock
private Log4jWebLifeCycle initializer;
private Log4jServletContextListener listener;
@Before
public void setUp() {
- this.event = createStrictMock(ServletContextEvent.class);
- this.servletContext = createStrictMock(ServletContext.class);
- this.initializer = createStrictMock(Log4jWebLifeCycle.class);
-
this.listener = new Log4jServletContextListener();
- }
-
- @After
- public void tearDown() {
- verify(this.event, this.servletContext, this.initializer);
+ given(event.getServletContext()).willReturn(servletContext);
+ given(servletContext.getAttribute(Log4jWebSupport.SUPPORT_ATTRIBUTE)).willReturn(initializer);
}
@Test
public void testInitAndDestroy() throws Exception {
- expect(this.event.getServletContext()).andReturn(this.servletContext);
- expect(this.servletContext.getAttribute(Log4jWebSupport.SUPPORT_ATTRIBUTE)).andReturn(this.initializer);
- this.initializer.start();
- expectLastCall();
- this.initializer.setLoggerContext();
- expectLastCall();
-
- replay(this.event, this.servletContext, this.initializer);
-
this.listener.contextInitialized(this.event);
- verify(this.event, this.servletContext, this.initializer);
- reset(this.event, this.servletContext, this.initializer);
-
- this.initializer.clearLoggerContext();
- expectLastCall();
- this.initializer.stop();
- expectLastCall();
-
- replay(this.event, this.servletContext, this.initializer);
+ then(initializer).should().start();
+ then(initializer).should().setLoggerContext();
this.listener.contextDestroyed(this.event);
+
+ then(initializer).should().clearLoggerContext();
+ then(initializer).should().stop();
}
@Test
public void testInitFailure() throws Exception {
- expect(this.event.getServletContext()).andReturn(this.servletContext);
- expect(this.servletContext.getAttribute(Log4jWebSupport.SUPPORT_ATTRIBUTE)).andReturn(this.initializer);
- this.initializer.start();
- expectLastCall().andThrow(new IllegalStateException(Strings.EMPTY));
-
- replay(this.event, this.servletContext, this.initializer);
+ willThrow(new IllegalStateException(Strings.EMPTY)).given(initializer).start();
try {
this.listener.contextInitialized(this.event);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletFilterTest.java
----------------------------------------------------------------------
diff --git a/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletFilterTest.java b/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletFilterTest.java
index bf6a84f..1fb72a3 100644
--- a/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletFilterTest.java
+++ b/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jServletFilterTest.java
@@ -22,131 +22,87 @@ import javax.servlet.ServletContext;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
-import static org.easymock.EasyMock.createStrictMock;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.reset;
-import static org.easymock.EasyMock.same;
-import static org.easymock.EasyMock.verify;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.same;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.BDDMockito.then;
+import static org.mockito.Mockito.reset;
+@RunWith(MockitoJUnitRunner.class)
public class Log4jServletFilterTest {
+ @Mock
private FilterConfig filterConfig;
+ @Mock
private ServletContext servletContext;
+ @Mock
private Log4jWebLifeCycle initializer;
+ @Mock
+ private ServletRequest request;
+ @Mock
+ private ServletResponse response;
+ @Mock
+ private FilterChain chain;
private Log4jServletFilter filter;
@Before
public void setUp() {
- this.filterConfig = createStrictMock(FilterConfig.class);
- this.servletContext = createStrictMock(ServletContext.class);
- this.initializer = createStrictMock(Log4jWebLifeCycle.class);
-
+ given(filterConfig.getServletContext()).willReturn(servletContext);
+ given(servletContext.getAttribute(Log4jWebSupport.SUPPORT_ATTRIBUTE)).willReturn(initializer);
this.filter = new Log4jServletFilter();
}
- @After
- public void tearDown() {
- verify(this.filterConfig, this.servletContext, this.initializer);
- }
-
@Test
public void testInitAndDestroy() throws Exception {
- expect(this.filterConfig.getServletContext()).andReturn(this.servletContext);
- expect(this.servletContext.getAttribute(Log4jWebSupport.SUPPORT_ATTRIBUTE)).andReturn(this.initializer);
- this.initializer.clearLoggerContext();
- expectLastCall();
-
- replay(this.filterConfig, this.servletContext, this.initializer);
-
this.filter.init(this.filterConfig);
- verify(this.filterConfig, this.servletContext, this.initializer);
- reset(this.filterConfig, this.servletContext, this.initializer);
-
- this.initializer.setLoggerContext();
- expectLastCall();
-
- replay(this.filterConfig, this.servletContext, this.initializer);
+ then(initializer).should().clearLoggerContext();
this.filter.destroy();
+
+ then(initializer).should().setLoggerContext();
}
@Test(expected = IllegalStateException.class)
public void testDestroy() {
- replay(this.filterConfig, this.servletContext, this.initializer);
-
this.filter.destroy();
}
@Test
public void testDoFilterFirstTime() throws Exception {
- expect(this.filterConfig.getServletContext()).andReturn(this.servletContext);
- expect(this.servletContext.getAttribute(Log4jWebSupport.SUPPORT_ATTRIBUTE)).andReturn(this.initializer);
- this.initializer.clearLoggerContext();
- expectLastCall();
-
- replay(this.filterConfig, this.servletContext, this.initializer);
-
this.filter.init(this.filterConfig);
- verify(this.filterConfig, this.servletContext, this.initializer);
- reset(this.filterConfig, this.servletContext, this.initializer);
-
- final ServletRequest request = createStrictMock(ServletRequest.class);
- final ServletResponse response = createStrictMock(ServletResponse.class);
- final FilterChain chain = createStrictMock(FilterChain.class);
-
- expect(request.getAttribute(Log4jServletFilter.ALREADY_FILTERED_ATTRIBUTE)).andReturn(null);
- request.setAttribute(eq(Log4jServletFilter.ALREADY_FILTERED_ATTRIBUTE), eq(Boolean.TRUE));
- expectLastCall();
- this.initializer.setLoggerContext();
- expectLastCall();
- chain.doFilter(same(request), same(response));
- expectLastCall();
- this.initializer.clearLoggerContext();
- expectLastCall();
+ then(initializer).should().clearLoggerContext();
+ reset(initializer);
- replay(this.filterConfig, this.servletContext, this.initializer, request, response, chain);
+ given(request.getAttribute(Log4jServletFilter.ALREADY_FILTERED_ATTRIBUTE)).willReturn(null);
this.filter.doFilter(request, response, chain);
- verify(request, response, chain);
+ then(request).should().setAttribute(eq(Log4jServletFilter.ALREADY_FILTERED_ATTRIBUTE), eq(true));
+ then(initializer).should().setLoggerContext();
+ then(chain).should().doFilter(same(request), same(response));
+ then(chain).shouldHaveNoMoreInteractions();
+ then(initializer).should().clearLoggerContext();
}
@Test
public void testDoFilterSecondTime() throws Exception {
- expect(this.filterConfig.getServletContext()).andReturn(this.servletContext);
- expect(this.servletContext.getAttribute(Log4jWebSupport.SUPPORT_ATTRIBUTE)).andReturn(this.initializer);
- this.initializer.clearLoggerContext();
- expectLastCall();
-
- replay(this.filterConfig, this.servletContext, this.initializer);
-
this.filter.init(this.filterConfig);
- verify(this.filterConfig, this.servletContext, this.initializer);
- reset(this.filterConfig, this.servletContext, this.initializer);
-
- final ServletRequest request = createStrictMock(ServletRequest.class);
- final ServletResponse response = createStrictMock(ServletResponse.class);
- final FilterChain chain = createStrictMock(FilterChain.class);
-
- expect(request.getAttribute(Log4jServletFilter.ALREADY_FILTERED_ATTRIBUTE)).andReturn(true);
- expectLastCall();
- chain.doFilter(same(request), same(response));
- expectLastCall();
+ then(initializer).should().clearLoggerContext();
- replay(this.filterConfig, this.servletContext, this.initializer, request, response, chain);
+ given(request.getAttribute(Log4jServletFilter.ALREADY_FILTERED_ATTRIBUTE)).willReturn(true);
this.filter.doFilter(request, response, chain);
- verify(request, response, chain);
+ then(chain).should().doFilter(same(request), same(response));
+ then(chain).shouldHaveNoMoreInteractions();
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jWebInitializerImplTest.java
----------------------------------------------------------------------
diff --git a/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jWebInitializerImplTest.java b/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jWebInitializerImplTest.java
index 8ed6046..7949e49 100644
--- a/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jWebInitializerImplTest.java
+++ b/log4j-web/src/test/java/org/apache/logging/log4j/web/Log4jWebInitializerImplTest.java
@@ -20,71 +20,56 @@ import javax.servlet.ServletContext;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.impl.ContextAnchor;
-import org.easymock.Capture;
-import org.easymock.EasyMock;
-import org.easymock.IAnswer;
-import org.junit.After;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
-import static org.easymock.EasyMock.capture;
-import static org.easymock.EasyMock.createStrictMock;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.reset;
-import static org.easymock.EasyMock.verify;
import static org.junit.Assert.*;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.BDDMockito.then;
+@RunWith(MockitoJUnitRunner.class)
public class Log4jWebInitializerImplTest {
+ @Mock
private ServletContext servletContext;
+ @Captor
+ private ArgumentCaptor<Log4jWebLifeCycle> initializerCaptor;
+ @Captor
+ private ArgumentCaptor<org.apache.logging.log4j.spi.LoggerContext> loggerContextCaptor;
+ @Rule
+ public ExpectedException expectedException = ExpectedException.none();
private Log4jWebInitializerImpl initializerImpl;
@Before
public void setUp() {
- final Capture<Log4jWebLifeCycle> initializerCapture = EasyMock.newCapture();
-
- this.servletContext = createStrictMock(ServletContext.class);
- expect(this.servletContext.getAttribute(Log4jWebSupport.SUPPORT_ATTRIBUTE)).andReturn(null);
- this.servletContext.setAttribute(eq(Log4jWebSupport.SUPPORT_ATTRIBUTE), capture(initializerCapture));
- expectLastCall();
-
- replay(this.servletContext);
+ given(servletContext.getAttribute(Log4jWebSupport.SUPPORT_ATTRIBUTE)).willReturn(null);
final Log4jWebLifeCycle initializer = WebLoggerContextUtils.getWebLifeCycle(this.servletContext);
+ then(servletContext).should().setAttribute(eq(Log4jWebSupport.SUPPORT_ATTRIBUTE), initializerCaptor.capture());
assertNotNull("The initializer should not be null.", initializer);
- assertSame("The capture is not correct.", initializer, initializerCapture.getValue());
+ assertSame("The capture is not correct.", initializer, initializerCaptor.getValue());
assertTrue("The initializer is not correct.", initializer instanceof Log4jWebInitializerImpl);
- verify(this.servletContext);
- reset(this.servletContext);
this.initializerImpl = (Log4jWebInitializerImpl) initializer;
}
- @After
- public void tearDown() {
- verify(this.servletContext);
- }
-
@Test
public void testDeinitializeBeforeInitialize() {
- replay(this.servletContext);
-
- try {
- this.initializerImpl.stop();
- fail("Expected an IllegalStateException.");
- } catch (final IllegalStateException ignore) {
-
- }
+ expectedException.expect(IllegalStateException.class);
+ this.initializerImpl.stop();
}
@Test
public void testSetLoggerContextBeforeInitialize() {
- replay(this.servletContext);
-
assertNull("The context should be null.", ContextAnchor.THREAD_CONTEXT.get());
this.initializerImpl.setLoggerContext();
@@ -94,8 +79,6 @@ public class Log4jWebInitializerImplTest {
@Test
public void testClearLoggerContextBeforeInitialize() {
- replay(this.servletContext);
-
assertNull("The context should be null.", ContextAnchor.THREAD_CONTEXT.get());
this.initializerImpl.clearLoggerContext();
@@ -105,32 +88,17 @@ public class Log4jWebInitializerImplTest {
@Test
public void testInitializeWithNoParametersThenSetLoggerContextThenDeinitialize() throws Exception {
- final Capture<Object> loggerContextCapture = EasyMock.newCapture();
-
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONTEXT_NAME)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONFIG_LOCATION)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))
- .andReturn(null);
- expect(this.servletContext.getServletContextName()).andReturn("helloWorld01");
- expect(this.servletContext.getResourcePaths("/WEB-INF/")).andReturn(null);
- this.servletContext.setAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE), capture(loggerContextCapture));
- expectLastCall();
-
- replay(this.servletContext);
-
- assertNull("The context should be null.", ContextAnchor.THREAD_CONTEXT.get());
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONTEXT_NAME))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONFIG_LOCATION))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))).willReturn(null);
+ given(servletContext.getServletContextName()).willReturn("helloWorld01");
+ given(servletContext.getResourcePaths("/WEB-INF/")).willReturn(null);
this.initializerImpl.start();
- assertNotNull("The context attribute should not be null.", loggerContextCapture.getValue());
- assertTrue("The context attribute is not correct.",
- loggerContextCapture.getValue() instanceof org.apache.logging.log4j.spi.LoggerContext);
- final org.apache.logging.log4j.spi.LoggerContext loggerContext =
- (org.apache.logging.log4j.spi.LoggerContext)loggerContextCapture.getValue();
-
- verify(this.servletContext);
- reset(this.servletContext);
- replay(this.servletContext);
+ then(servletContext).should().setAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE), loggerContextCaptor.capture());
+ assertNotNull("The context attribute should not be null.", loggerContextCaptor.getValue());
+ final org.apache.logging.log4j.spi.LoggerContext loggerContext = loggerContextCaptor.getValue();
assertNull("The context should still be null.", ContextAnchor.THREAD_CONTEXT.get());
@@ -144,19 +112,9 @@ public class Log4jWebInitializerImplTest {
assertNull("The context should be null again.", ContextAnchor.THREAD_CONTEXT.get());
- verify(this.servletContext);
- reset(this.servletContext);
-
- this.servletContext.removeAttribute(Log4jWebSupport.CONTEXT_ATTRIBUTE);
- expectLastCall();
-
- replay(this.servletContext);
-
this.initializerImpl.stop();
- verify(this.servletContext);
- reset(this.servletContext);
- replay(this.servletContext);
+ then(servletContext).should().removeAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE));
assertNull("The context should again still be null.", ContextAnchor.THREAD_CONTEXT.get());
@@ -167,33 +125,19 @@ public class Log4jWebInitializerImplTest {
@Test
public void testInitializeWithClassLoaderNoParametersThenSetLoggerContextThenDeinitialize() throws Exception {
- final Capture<Object> loggerContextCapture = EasyMock.newCapture();
-
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONTEXT_NAME)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONFIG_LOCATION)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))
- .andReturn("false");
- expect(this.servletContext.getServletContextName()).andReturn("helloWorld02");
- expect(this.servletContext.getResourcePaths("/WEB-INF/")).andReturn(null);
- expect(this.servletContext.getClassLoader()).andReturn(this.getClass().getClassLoader());
- this.servletContext.setAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE), capture(loggerContextCapture));
- expectLastCall();
-
- replay(this.servletContext);
-
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONTEXT_NAME))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONFIG_LOCATION))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))).willReturn("false");
+ given(servletContext.getServletContextName()).willReturn("helloWorld02");
+ given(servletContext.getResourcePaths("/WEB-INF/")).willReturn(null);
+ given(servletContext.getClassLoader()).willReturn(getClass().getClassLoader());
assertNull("The context should be null.", ContextAnchor.THREAD_CONTEXT.get());
this.initializerImpl.start();
- assertNotNull("The context attribute should not be null.", loggerContextCapture.getValue());
- assertTrue("The context attribute is not correct.",
- loggerContextCapture.getValue() instanceof org.apache.logging.log4j.spi.LoggerContext);
- final org.apache.logging.log4j.spi.LoggerContext loggerContext =
- (org.apache.logging.log4j.spi.LoggerContext)loggerContextCapture.getValue();
-
- verify(this.servletContext);
- reset(this.servletContext);
- replay(this.servletContext);
+ then(servletContext).should().setAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE), loggerContextCaptor.capture());
+ assertNotNull("The context attribute should not be null.", loggerContextCaptor.getValue());
+ final org.apache.logging.log4j.spi.LoggerContext loggerContext = loggerContextCaptor.getValue();
assertNull("The context should still be null.", ContextAnchor.THREAD_CONTEXT.get());
@@ -207,19 +151,9 @@ public class Log4jWebInitializerImplTest {
assertNull("The context should be null again.", ContextAnchor.THREAD_CONTEXT.get());
- verify(this.servletContext);
- reset(this.servletContext);
-
- this.servletContext.removeAttribute(Log4jWebSupport.CONTEXT_ATTRIBUTE);
- expectLastCall();
-
- replay(this.servletContext);
-
this.initializerImpl.stop();
- verify(this.servletContext);
- reset(this.servletContext);
- replay(this.servletContext);
+ then(servletContext).should().removeAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE));
assertNull("The context should again still be null.", ContextAnchor.THREAD_CONTEXT.get());
@@ -230,168 +164,95 @@ public class Log4jWebInitializerImplTest {
@Test
public void testInitializeIsIdempotent() throws Exception {
- final Capture<Object> loggerContextCapture = EasyMock.newCapture();
-
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONTEXT_NAME)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONFIG_LOCATION)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))
- .andReturn("nothing");
- expect(this.servletContext.getServletContextName()).andReturn("helloWorld03");
- expect(this.servletContext.getResourcePaths("/WEB-INF/")).andReturn(null);
- expect(this.servletContext.getClassLoader()).andReturn(this.getClass().getClassLoader());
- this.servletContext.setAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE), capture(loggerContextCapture));
- expectLastCall();
-
- replay(this.servletContext);
-
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONTEXT_NAME))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONFIG_LOCATION))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))).willReturn("nothing");
+ given(servletContext.getServletContextName()).willReturn("helloWorld03");
+ given(servletContext.getResourcePaths("/WEB-INF/")).willReturn(null);
+ given(servletContext.getClassLoader()).willReturn(getClass().getClassLoader());
assertNull("The context should be null.", ContextAnchor.THREAD_CONTEXT.get());
this.initializerImpl.start();
- assertNotNull("The context attribute should not be null.", loggerContextCapture.getValue());
- assertTrue("The context attribute is not correct.",
- loggerContextCapture.getValue() instanceof org.apache.logging.log4j.spi.LoggerContext);
-
- verify(this.servletContext);
- reset(this.servletContext);
- replay(this.servletContext);
+ then(servletContext).should().setAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE), loggerContextCaptor.capture());
+ assertNotNull("The context attribute should not be null.", loggerContextCaptor.getValue());
this.initializerImpl.start();
this.initializerImpl.start();
this.initializerImpl.start();
-
- verify(this.servletContext);
- reset(this.servletContext);
-
- this.servletContext.removeAttribute(Log4jWebSupport.CONTEXT_ATTRIBUTE);
- expectLastCall();
-
- replay(this.servletContext);
-
this.initializerImpl.stop();
+
+ then(servletContext).should().removeAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE));
}
@Test
public void testInitializeFailsAfterDeinitialize() throws Exception {
- final Capture<Object> loggerContextCapture = EasyMock.newCapture();
-
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONTEXT_NAME)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONFIG_LOCATION)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))
- .andReturn(null);
- expect(this.servletContext.getServletContextName()).andReturn("helloWorld04");
- expect(this.servletContext.getResourcePaths("/WEB-INF/")).andReturn(null);
- expect(this.servletContext.getClassLoader()).andReturn(this.getClass().getClassLoader());
- this.servletContext.setAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE), capture(loggerContextCapture));
- expectLastCall();
-
- replay(this.servletContext);
-
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONTEXT_NAME))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONFIG_LOCATION))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))).willReturn(null);
+ given(servletContext.getServletContextName()).willReturn("helloWorld04");
+ given(servletContext.getResourcePaths("/WEB-INF/")).willReturn(null);
+ given(servletContext.getClassLoader()).willReturn(getClass().getClassLoader());
assertNull("The context should be null.", ContextAnchor.THREAD_CONTEXT.get());
this.initializerImpl.start();
- assertNotNull("The context attribute should not be null.", loggerContextCapture.getValue());
- assertTrue("The context attribute is not correct.",
- loggerContextCapture.getValue() instanceof org.apache.logging.log4j.spi.LoggerContext);
-
- verify(this.servletContext);
- reset(this.servletContext);
-
- this.servletContext.removeAttribute(Log4jWebSupport.CONTEXT_ATTRIBUTE);
- expectLastCall();
-
- replay(this.servletContext);
+ then(servletContext).should().setAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE), loggerContextCaptor.capture());
+ assertNotNull("The context attribute should not be null.", loggerContextCaptor.getValue());
this.initializerImpl.stop();
- try {
- this.initializerImpl.start();
- fail("Expected an IllegalStateException.");
- } catch (final IllegalStateException ignore) {
+ then(servletContext).should().removeAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE));
- }
+ expectedException.expect(IllegalStateException.class);
+ this.initializerImpl.start();
}
@Test
public void testDeinitializeIsIdempotent() throws Exception {
- final Capture<Object> loggerContextCapture = EasyMock.newCapture();
-
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONTEXT_NAME)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONFIG_LOCATION)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))
- .andReturn(null);
- expect(this.servletContext.getServletContextName()).andReturn("helloWorld05");
- expect(this.servletContext.getResourcePaths("/WEB-INF/")).andReturn(null);
- expect(this.servletContext.getClassLoader()).andReturn(this.getClass().getClassLoader());
- this.servletContext.setAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE), capture(loggerContextCapture));
- expectLastCall();
-
- replay(this.servletContext);
-
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONTEXT_NAME))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONFIG_LOCATION))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))).willReturn(null);
+ given(servletContext.getServletContextName()).willReturn("helloWorld05");
+ given(servletContext.getResourcePaths("/WEB-INF/")).willReturn(null);
+ given(servletContext.getClassLoader()).willReturn(getClass().getClassLoader());
assertNull("The context should be null.", ContextAnchor.THREAD_CONTEXT.get());
this.initializerImpl.start();
- assertNotNull("The context attribute should not be null.", loggerContextCapture.getValue());
- assertTrue("The context attribute is not correct.",
- loggerContextCapture.getValue() instanceof org.apache.logging.log4j.spi.LoggerContext);
-
- verify(this.servletContext);
- reset(this.servletContext);
-
- this.servletContext.removeAttribute(Log4jWebSupport.CONTEXT_ATTRIBUTE);
- expectLastCall();
-
- replay(this.servletContext);
+ then(servletContext).should().setAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE), loggerContextCaptor.capture());
+ assertNotNull("The context attribute should not be null.", loggerContextCaptor.getValue());
this.initializerImpl.stop();
this.initializerImpl.stop();
this.initializerImpl.stop();
+ then(servletContext).should().removeAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE));
}
@Test
public void testInitializeUsingJndiSelectorFails() throws Exception {
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONTEXT_NAME)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONFIG_LOCATION)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))
- .andReturn("true");
- expect(this.servletContext.getResourcePaths("/WEB-INF/")).andReturn(null);
- replay(this.servletContext);
-
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONTEXT_NAME))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONFIG_LOCATION))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))).willReturn("true");
+ given(servletContext.getResourcePaths("/WEB-INF/")).willReturn(null);
assertNull("The context should be null.", ContextAnchor.THREAD_CONTEXT.get());
- try {
- this.initializerImpl.start();
- fail("Expected an IllegalStateException.");
- } catch (final IllegalStateException ignore) {
- // ignore
- }
+ expectedException.expect(IllegalStateException.class);
+ this.initializerImpl.start();
}
@Test
public void testInitializeUsingJndiSelector() throws Exception {
- final Capture<Object> loggerContextCapture = EasyMock.newCapture();
-
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONTEXT_NAME)).andReturn("helloWorld6");
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONFIG_LOCATION)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))
- .andReturn("true");
- expect(this.servletContext.getResourcePaths("/WEB-INF/")).andReturn(null);
- this.servletContext.setAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE), capture(loggerContextCapture));
- expectLastCall();
-
- replay(this.servletContext);
-
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONTEXT_NAME))).willReturn("helloWorld06");
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONFIG_LOCATION))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))).willReturn("true");
+ given(servletContext.getResourcePaths("/WEB-INF/")).willReturn(null);
assertNull("The context should be null.", ContextAnchor.THREAD_CONTEXT.get());
this.initializerImpl.start();
- assertNull("The context attribute should be null.", loggerContextCapture.getValue());
-
- verify(this.servletContext);
- reset(this.servletContext);
- replay(this.servletContext);
+ then(servletContext).should().setAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE), loggerContextCaptor.capture());
+ assertNull("The context attribute should be null.", loggerContextCaptor.getValue());
assertNull("The context should still be null.", ContextAnchor.THREAD_CONTEXT.get());
@@ -403,16 +264,8 @@ public class Log4jWebInitializerImplTest {
assertNull("The context should be null again.", ContextAnchor.THREAD_CONTEXT.get());
- verify(this.servletContext);
- reset(this.servletContext);
- replay(this.servletContext);
-
this.initializerImpl.stop();
- verify(this.servletContext);
- reset(this.servletContext);
- replay(this.servletContext);
-
assertNull("The context should again still be null.", ContextAnchor.THREAD_CONTEXT.get());
this.initializerImpl.setLoggerContext();
@@ -422,65 +275,37 @@ public class Log4jWebInitializerImplTest {
@Test
public void testWrapExecutionWithNoParameters() throws Exception {
- final Capture<Object> loggerContextCapture = EasyMock.newCapture();
-
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONTEXT_NAME)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.LOG4J_CONFIG_LOCATION)).andReturn(null);
- expect(this.servletContext.getInitParameter(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))
- .andReturn(null);
- expect(this.servletContext.getServletContextName()).andReturn("helloWorld01");
- expect(this.servletContext.getResourcePaths("/WEB-INF/")).andReturn(null);
- this.servletContext.setAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE), capture(loggerContextCapture));
- expectLastCall();
-
- replay(this.servletContext);
-
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONTEXT_NAME))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.LOG4J_CONFIG_LOCATION))).willReturn(null);
+ given(servletContext.getInitParameter(eq(Log4jWebSupport.IS_LOG4J_CONTEXT_SELECTOR_NAMED))).willReturn(null);
+ given(servletContext.getServletContextName()).willReturn("helloWorld07");
+ given(servletContext.getResourcePaths("/WEB-INF/")).willReturn(null);
assertNull("The context should be null.", ContextAnchor.THREAD_CONTEXT.get());
this.initializerImpl.start();
- assertNotNull("The context attribute should not be null.", loggerContextCapture.getValue());
- assertTrue("The context attribute is not correct.",
- loggerContextCapture.getValue() instanceof org.apache.logging.log4j.spi.LoggerContext);
- final org.apache.logging.log4j.spi.LoggerContext loggerContext =
- (org.apache.logging.log4j.spi.LoggerContext)loggerContextCapture.getValue();
-
- verify(this.servletContext);
- reset(this.servletContext);
+ then(servletContext).should().setAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE), loggerContextCaptor.capture());
+ assertNotNull("The context attribute should not be null.", loggerContextCaptor.getValue());
+ final org.apache.logging.log4j.spi.LoggerContext loggerContext = loggerContextCaptor.getValue();
assertNull("The context should still be null.", ContextAnchor.THREAD_CONTEXT.get());
- final Runnable runnable = createStrictMock(Runnable.class);
- runnable.run();
- expectLastCall().andAnswer(new IAnswer<Void>() {
+ final Runnable runnable = new Runnable() {
@Override
- public Void answer() {
+ public void run() {
final LoggerContext context = ContextAnchor.THREAD_CONTEXT.get();
assertNotNull("The context should not be null.", context);
assertSame("The context is not correct.", loggerContext, context);
- return null;
}
- });
-
- replay(this.servletContext, runnable);
+ };
this.initializerImpl.wrapExecution(runnable);
assertNull("The context should be null again.", ContextAnchor.THREAD_CONTEXT.get());
- verify(this.servletContext, runnable);
- reset(this.servletContext);
-
- this.servletContext.removeAttribute(Log4jWebSupport.CONTEXT_ATTRIBUTE);
- expectLastCall();
-
- replay(this.servletContext);
-
this.initializerImpl.stop();
- verify(this.servletContext);
- reset(this.servletContext);
- replay(this.servletContext);
+ then(servletContext).should().removeAttribute(eq(Log4jWebSupport.CONTEXT_ATTRIBUTE));
assertNull("The context should again still be null.", ContextAnchor.THREAD_CONTEXT.get());
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index be4d7e4..86051d7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -224,6 +224,7 @@
<!-- Allow Clirr severity to be overriden by the command-line option -DminSeverity=level -->
<minSeverity>info</minSeverity>
<jctoolsVersion>1.2.1</jctoolsVersion>
+ <mockitoVersion>2.2.7</mockitoVersion>
</properties>
<pluginRepositories>
<pluginRepository>
@@ -653,9 +654,9 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>3.4</version>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>${mockitoVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78c6a1fc/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 4e0eb6e..56bf22f 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -42,6 +42,9 @@
<action issue="LOG4J2-1647" dev="mattsicker" type="update">
Update Commons Lang from 3.4 to 4.5.
</action>
+ <action issue="LOG4J2-1646" dev="mattsicker" type="update">
+ Migrate to Mockito 2.x in unit tests.
+ </action>
</release>
<release version="2.7" date="2016-10-02" description="GA Release 2.7">
<action issue="LOG4J2-1618" dev="rpopma" type="fix" due-to="Raman Gupta">
[19/50] [abbrv] logging-log4j2 git commit: Prepare for release
Posted by mi...@apache.org.
Prepare for release
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d7f1919f
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d7f1919f
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d7f1919f
Branch: refs/heads/LOG4J2-1390
Commit: d7f1919f239422dcc494c70a542e3f19c60c00b4
Parents: d5269df
Author: rgoers <ra...@dslextreme.com>
Authored: Sun Oct 2 10:52:35 2016 -0700
Committer: rgoers <ra...@dslextreme.com>
Committed: Sun Oct 2 10:52:35 2016 -0700
----------------------------------------------------------------------
RELEASE-NOTES.txt | 3 +++
src/changes/changes.xml | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d7f1919f/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index a668cf4..13d7fda 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -69,6 +69,8 @@ o LOG4J2-1540: The Core AbstractManager now tracks its LoggerContext.
o LOG4J2-1577: Add a Builder to the RoutingAppender and deprecate factory method.
Fixed Bugs:
+o LOG4J2-1618: Fixed ClassCastException when using JUL logging during shutdown. Thanks to Raman Gupta.
+o LOG4J2-1620: 2.7-rc1: RollingFileAppender immediateFlush default value should be true, not false. Thanks to Sascha Scholz.
o LOG4J2-1611: Improved performance of context data injector for web applications to be on par with standalone applications.
o LOG4J2-1591: Introduced new interface LifeCycle2 with stop(long,TimeUnit) method to avoid breaking backwards compatibility with new Configurator.shutdown(LoggerContext, long, TimeUnit) API.
o LOG4J2-1590: Fixed issue with filters extending AbstractFilter that did not override methods with unrolled varargs.
@@ -121,6 +123,7 @@ o LOG4J2-1601: Prevent potential NPE due to org.apache.logging.log4j.core.layou
o LOG4J2-1602: Prevent potential NPE in org.apache.logging.log4j.core.util.datetime.FormatCache.MultipartKey.equals(Object) when object is null.
o LOG4J2-1603: Redo hashCode() and equals() methods in org.apache.logging.log4j.core.net.ssl classes.
o LOG4J2-1610: Add targetNamespace to log4j-config.xsd. GitHub #43. Thanks to Shubhankar.
+o LOG4J2-1619: new Log4jLogEvent().toString() throws an NPE.
Changes:
o LOG4J2-1604: Log4j2 TcpSocketServer in background. Thanks to Colin Hillman.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d7f1919f/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index a304ac7..cd2f379 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -23,7 +23,7 @@
<title>Changes</title>
</properties>
<body>
- <release version="2.7" date="2016-09-25" description="GA Release 2.7">
+ <release version="2.7" date="2016-10-02" description="GA Release 2.7">
<action issue="LOG4J2-1618" dev="rpopma" type="fix" due-to="Raman Gupta">
Fixed ClassCastException when using JUL logging during shutdown.
</action>
[41/50] [abbrv] logging-log4j2 git commit: Merge branch 'master' into
LOG4J2-1623
Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/19418b37/src/changes/changes.xml
----------------------------------------------------------------------
diff --cc src/changes/changes.xml
index 6bd144c,d935048..2922511
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@@ -1,3090 -1,3096 +1,3099 @@@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set sw=2: -->
-<!--
- 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.
--->
-<document xmlns="http://maven.apache.org/changes/1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/xsd/changes-1.0.0.xsd">
- <properties>
- <title>Changes</title>
- </properties>
- <body>
- <release version="2.7.1" date="2016-MM-DD" description="GA Release 2.7.1">
- <action issue="LOG4J2-1636" dev="ggregory" type="fix" due-to="Eldar Gabdullin">
- Console Appender does not pick up Oracle Java 8's sun.stdout.encoding and sun.stderr.encoding.
- </action>
- <action issue="LOG4J2-1639" dev="ggregory" type="fix" due-to="Sridhar Gopinath">
- Fix MemoryMappedFileAppender.createAppender() Javadoc for immediateFlush.
- </action>
- <action issue="LOG4J2-1641" dev="ggregory" type="update">
- Update JeroMQ from 0.3.5 to 0.3.6.
- </action>
- </release>
- <release version="2.7" date="2016-10-02" description="GA Release 2.7">
- <action issue="LOG4J2-1618" dev="rpopma" type="fix" due-to="Raman Gupta">
- Fixed ClassCastException when using JUL logging during shutdown.
- </action>
- <action issue="LOG4J2-1620" dev="ggregory" type="fix" due-to="Sascha Scholz">
- 2.7-rc1: RollingFileAppender immediateFlush default value should be true, not false.
- </action>
- <action issue="LOG4J2-1611" dev="rpopma" type="fix">
- Improved performance of context data injector for web applications to be on par with standalone applications.
- </action>
- <action issue="LOG4J2-1591" dev="rpopma" type="fix">
- Introduced new interface LifeCycle2 with stop(long,TimeUnit) method to avoid breaking backwards compatibility with new Configurator.shutdown(LoggerContext, long, TimeUnit) API.
- </action>
- <action issue="LOG4J2-1590" dev="rpopma" type="fix">
- Fixed issue with filters extending AbstractFilter that did not override methods with unrolled varargs.
- </action>
- <action issue="LOG4J2-1583" dev="rpopma" type="fix" due-to="Larry West">
- Fixed scrambled log messages triggered by nested logging from toString() method of a logging parameter object.
- </action>
- <action issue="LOG4J2-1259" dev="ggregory" type="fix" due-to="Misagh Moayyed, Steffen Offermann">
- Log4j threads are no longer leaking on Tomcat shutdown.
- </action>
- <action issue="LOG4J2-1051" dev="rpopma" type="fix" due-to="Lukasz Lenart">
- When starting on Google App Engine, Interpolator now suppresses the NoClassDefFoundError stack trace for the jvmrunargs lookup.
- </action>
- <action issue="LOG4J2-1582" dev="rpopma" type="fix">
- When initializing on platforms where JMX is not available, Interpolator component no longer prints stack trace for warning messages.
- </action>
- <action issue="LOG4J2-1581" dev="rpopma" type="fix">
- Unregistering JMX components no longer prints a stack trace when the MBean has already been unregistered.
- </action>
- <action issue="LOG4J2-1313" dev="rpopma" type="fix" due-to="Philipp Knobel, Leon Finker">
- Support Property values to be specified in configuration as a value attribute as well as an element.
- </action>
- <action issue="LOG4J2-1575" dev="rpopma" type="fix">
- (GC) LoggerConfig now stores configuration properties in a List, not a Map to prevent creating temporary Iterator objects. Added method LoggerConfig#getPropertyList(), deprecated method #getProperties().
- </action>
- <action issue="LOG4J2-1457" dev="mattsicker" type="fix" due-to="Leon Finker">
- 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">
- 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">
- 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.
- </action>
- <action issue="LOG4J2-1542" dev="rpopma" type="fix" due-to="Rog�rio Lecari�o Leite">
- Prevent ArrayIndexOutOfBoundsException in ParameterizedMessage.formatTo for single-char or empty messages.
- </action>
- <action issue="LOG4J2-1549" dev="mikes" type="fix" due-to="Jason Bedard">
- Fixed issue where AsyncLoggerContextSelector+PropertiesConfigurationBuilder defaulted to includeLocation=true.
- </action>
- <action issue="LOG4J2-1562" dev="ggregory" type="fix">
- 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">
- Prevent NPE in Level.isInRange.
- </action>
- <action issue="LOG4J2-1511" dev="ggregory" type="fix" due-to="Srikanth Surukuntu">
- DynamicThresholdFilter filtered incorrectly when params were passed as individual arguments instead of varargs.
- </action>
- <action issue="LOG4J2-1548" dev="ggregory" type="fix">
- [CronTriggeringPolicy] ConfigurationScheduler scheduled the task infinitely after first fire.
- </action>
- <action issue="LOG4J2-1506" dev="ggregory" type="fix" due-to="Johannes Schleger">
- 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">
- 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">
- 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">
- Prevent NPE when dynamically removing filters.
- </action>
- <action issue="LOG4J2-1532" dev="ggregory" type="fix">
- Attributes were not merged properly in composite configurations.
- </action>
- <action issue="LOG4J2-1529" dev="mattsicker" type="fix" due-to="Sridevi Narra">
- 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="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">
- 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 failed with an NPE when comparing Nodes with different attributes.
- </action>
- <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">
- Documented that JVM Input Arguments Lookup (JMX) is not available on Google App Engine.
- </action>
- <action issue="LOG4J2-1438" dev="rpopma" type="fix">
- (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.
- </action>
- <action issue="LOG4J2-1489" dev="rpopma" type="fix" due-to="Richard Zschech">
- (GC) Fixed %date conversion patterns with a timezone parameter are now garbage free.
- </action>
- <action issue="LOG4J2-1279" dev="rpopma" type="fix" due-to="Tony Baines">
- Prevent NullPointerException in FastDateParser$TimeZoneStrategy.
- </action>
- <action issue="LOG4J2-1341" dev="rpopma" type="fix" due-to="Richard Zschech">
- (GC) HighlightConverter and StyleConverter are now GC-free.
- </action>
- <action issue="LOG4J2-1467" dev="rpopma, ggregory" type="fix" due-to="Ralf, Gary Gregory">
- [OSGi] Fixed missing import package.
- </action>
- <action issue="LOG4J2-351" dev="rpopma, ggregory" type="fix" due-to="Roland Weiglhofer">
- [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 was not working correctly.
- </action>
- <action issue="LOG4J2-1502" dev="ggregory" type="fix" due-to="Sumit Singhal">
- Fixed issue where CsvParameterLayout and CsvLogEventLayout inserted NUL characters if data starts with {, (, [ or "
- </action>
- <action issue="LOG4J2-1573" dev="ggregory" type="fix" due-to="Steffen Offermann">
- Layout is no longer optional.
- </action>
- <action issue="LOG4J2-1608" dev="ggregory" type="fix">
- ServletAppender does not provide throwable object to ServletContext.
- </action>
- <action issue="LOG4J2-1599" dev="ggregory" type="fix">
- Prevent potential NPE in org.apache.logging.log4j.message.ParameterFormatter.formatMessage3(StringBuilder, char[], int, Object[], int, int[]).
- </action>
- <action issue="LOG4J2-1600" dev="ggregory" type="fix">
- Prevent potential NPE due to org.apache.logging.log4j.core.layout.MarkerPatternSelector.createSelector(PatternMatch[], String, boolean, boolean, Configuration).
- </action>
- <action issue="LOG4J2-1601" dev="ggregory" type="fix">
- Prevent potential NPE due to org.apache.logging.log4j.core.layout.ScriptPatternSelector.createSelector(AbstractScript, PatternMatch[], String, boolean, boolean, Configuration).
- </action>
- <action issue="LOG4J2-1602" dev="ggregory" type="fix">
- Prevent potential NPE in org.apache.logging.log4j.core.util.datetime.FormatCache.MultipartKey.equals(Object) when object is null.
- </action>
- <action issue="LOG4J2-1603" dev="ggregory" type="fix">
- Redo hashCode() and equals() methods in org.apache.logging.log4j.core.net.ssl classes.
- </action>
- <action issue="LOG4J2-1610" dev="ggregory" type="fix" due-to="Shubhankar">
- Add targetNamespace to log4j-config.xsd. GitHub #43.
- </action>
- <action issue="LOG4J2-1619" dev="ggregory" type="fix">
- new Log4jLogEvent().toString() throws an NPE.
- </action>
- <action issue="LOG4J2-1578" dev="ggregory" type="add">
- RoutingAppender can be configured with scripts. Add Script in a Routes element.
- </action>
- <action issue="LOG4J2-1597" dev="ggregory" type="add">
- Add a ScriptAppenderSelector to create an Appender specified by a Script.
- </action>
- <action issue="LOG4J2-1349" dev="rpopma" type="add">
- (GC) Added support for garbage-free ThreadContext map. Disabled by default, users need to enable this explicitly.
- </action>
- <action issue="LOG4J2-1447" dev="rpopma" type="add">
- (GC) Changed LogEvent's internal data structure for context data to be garbage-free. Added method LogEvent#getContextData(), deprecated method #getContextMap().
- </action>
- <action issue="LOG4J2-1010" dev="rpopma" type="add" due-to="Mikael St�ldal">
- Users can now inject context data from other sources than ThreadContext. Values can be any Object, not just Strings.
- </action>
- <action issue="LOG4J2-1568" dev="mattsicker" type="add">
- Added support for java.util.concurrent.LinkedTransferQueue to AsyncAppender.
- </action>
- <action issue="LOG4J2-1430" dev="mattsicker" type="add" due-to="John Cairns">
- Added optional support for Conversant DisruptorBlockingQueue in AsyncAppender.
- </action>
- <action issue="LOG4J2-1439" dev="mattsicker" type="add" due-to="Anthony Maire">
- Added optional support for JCTools MPSC bounded lock-free queue in AsyncAppender.
- </action>
- <action issue="LOG4J2-1558" dev="ggregory" type="add">
- SocketAppender now supports IO buffering.
- </action>
- <action issue="LOG4J2-1557" dev="ggregory" type="add">
- Add a Builder for the SocketAppender (deprecates factory method).
- </action>
- <action issue="LOG4J2-1609" dev="ggregory" type="add">
- Add a Builder to ServletAppender and deprecate factory method.
- </action>
- <action issue="LOG4J2-1553" dev="ggregory" type="add">
- AbstractManager now implements AutoCloseable.
- </action>
- <action issue="LOG4J2-1528" dev="mikes" type="add">
- Added ability to generate Log4j 2-style XML configuration file from ConfigurationBuilder.
- </action>
- <action issue="LOG4J2-1181" dev="mikes" type="add">
- Added Logging API for Scala 2.10 and 2.11.
- </action>
- <action issue="LOG4J2-1512" dev="mikes" type="add">
- Added options to exclude stack trace from JSON, XML and YAML layouts.
- </action>
- <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">
- FileAppender is now able to create files on-demand.
- </action>
- <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">
- [PatternLayout] Add an ANSI option to %xThrowable.
- </action>
- <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">
- [PatternLayout] Add an ANSI option to %message.
- </action>
- <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">
- Allow Builders to be completely generic.
- </action>
- <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<String, String>).
- </action>
- <action issue="LOG4J2-1519" dev="ggregory" type="add">
- Add ThreadContext.putAll(Map<String, String>).
- </action>
- <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">
- The Core AbstractConfiguration now tracks its LoggerContext and add Configuration.getLoggerContext().
- </action>
- <action issue="LOG4J2-1540" dev="ggregory" type="add">
- The Core AbstractManager now tracks its LoggerContext.
- </action>
- <action issue="LOG4J2-1577" dev="ggregory" type="add">
- Add a Builder to the RoutingAppender and deprecate factory method.
- </action>
- <action issue="LOG4J2-1604" dev="ggregory" type="update" due-to="Colin Hillman">
- Log4j2 TcpSocketServer in background.
- </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 now extend Log4jThread.
- </action>
- <action issue="LOG4J2-1605" dev="ggregory" type="update">
- Improve error messages for TcpSocketServer and UdpSocketServer.
- </action>
- <action issue="LOG4J2-1458" dev="ggregory" type="update">
- Updated Jackson from 2.7.5 to 2.8.0.
- </action>
- <action issue="LOG4J2-1494" dev="ggregory" type="update">
- Updated Jackson from 2.8.0 to 2.8.1.
- </action>
- <action issue="LOG4J2-1569" dev="ggregory" type="update">
- Updated Jackson from 2.8.1 to 2.8.2.
- </action>
- <action issue="LOG4J2-1598" dev="ggregory" type="update">
- Updated Jackson from 2.8.2 to 2.8.3.
- </action>
- <action issue="LOG4J2-1495" dev="ggregory" type="update">
- Updated LMAX Disruptor from 3.3.4 to 3.3.5.
- </action>
- <action issue="LOG4J2-1496" dev="ggregory" type="update">
- Updated Kafka client from 0.9.1.0 to 0.10.0.0.
- </action>
- <action issue="LOG4J2-1533" dev="ggregory" type="update">
- Updated Kafka client from 0.10.0.0 to 0.10.0.1.
- </action>
- <action issue="LOG4J2-1487" dev="ggregory" type="update">
- Updated JMS test from ActiveMQ 5.13.3 to 5.13.4.
- </action>
- <action issue="LOG4J2-1551" dev="ggregory" type="update">
- Updated JMS test from ActiveMQ 5.13.4 to 5.14.0.
- </action>
- <action issue="LOG4J2-1543" dev="ggregory" type="update">
- Removed deprecated Core API org.apache.logging.log4j.core.util.Constants.UTF_8.
- </action>
- <action issue="LOG4J2-1544" dev="ggregory" type="update">
- Removed deprecated Core API org.apache.logging.log4j.core.util.Assert.requireNonNull(T, String).
- </action>
- <action issue="LOG4J2-1545" dev="ggregory" type="update">
- 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">
- <action issue="LOG4J2-904" dev="rgoers" type="fix" due-to="Bernhard M�hr">
- If copy and delete fails in rename action then resort to truncating the source file after copying it.
- </action>
- <action issue="LOG4J2-1250" dev="rgoers" type="fix">
- CronTriggeringPolicy was not properly setting the prevFileTime value for the PatternProcessor so
- file dates and times on rolled files were incorrect.
- </action>
- <action issue="LOG4J2-1452" dev="rpopma" type="fix" due-to="Mikael St�ldal">
- Fixed issue where reusable messages broke flow tracing logic.
- </action>
- <action issue="LOG4J2-1440" dev="rgoers" type="fix">
- Fix bug in OnStartupTriggeringPolicy that allowed it to roll over on every reconfiguration. Added
- minSize attribute.
- </action>
- <action issue="LOG4J2-1414" dev="rpopma" type="fix" due-to="Ralph Goers">
- Fixed minor issues with the 2.6.1 web site.
- </action>
- <action issue="LOG4J2-1434" dev="rpopma" type="fix" due-to="Luke Butters">
- Ensure that the thread-local StringBuilders used by Layouts to format log events to text will not
- retain excessive memory after a large message was logged.
- </action>
- <action issue="LOG4J2-1395" dev="mikes" type="add">
- Add "direct" option to ConsoleAppender for increased performance.
- </action>
- <action issue="LOG4J2-1418" dev="mikes" type="fix">
- Provide MessageFactory2 to custom Logger implementations.
- </action>
- <action issue="LOG4J2-1420" dev="rgoers" type="fix">
- RollingRandomAccessFileManager was not properly rolling over on startup and was getting a NullPointerException.
- </action>
- <action issue="LOG4J2-1417" dev="rpopma" type="fix">
- Fixed issue where Unbox utility ignored the value Constants.ENABLE_THREADLOCALS and always stored non-JDK classes in ThreadLocals.
- </action>
- <action issue="LOG4J2-1422" dev="rpopma" type="fix">
- Fixed issue where AsyncAppenderQueueFullPolicyTest sometimes hangs.
- </action>
- <action issue="LOG4J2-1445" dev="ggregory" type="fix" due-to="Ludovic HOCHET">
- OnStartupTriggeringPolicyTest fails on Windows saying the file is used by another process.
- </action>
- <action issue="LOG4J2-1437" dev="rpopma" type="add">
- (GC) ObjectMessage and ReusableObjectMessage now avoid calling toString() on auto-boxed primitive parameters.
- </action>
- <action issue="LOG4J2-1415" dev="rpopma" type="add">
- (GC) ParameterFormatter now avoids calling toString() on auto-boxed primitive message parameters.
- </action>
- <action issue="LOG4J2-1412" dev="rpopma" type="add">
- Unbox utility's ringbuffer of StringBuilders is now configurable.
- </action>
- <action issue="LOG4J2-1432" dev="ggregory" type="update">
- Update Jackson from 2.7.4 to 2.7.5.
- </action>
- <action issue="LOG4J2-1433" dev="ggregory" type="update">
- Update Jansi from 1.11 to 1.13.
- </action>
- <action issue="LOG4J2-1444" dev="ggregory" type="update">
- Update Apache Commons Compress from 1.11 to 1.12.
- </action>
- </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.
- </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.
- </action>
- <action issue="LOG4J2-1409" dev="rpopma" type="fix" due-to="Shahan">
- Fixed ArrayIndexOutOfBoundsException that may occur in ReusableParameterizedMessage.
- </action>
- <action issue="LOG4J2-997" dev="rgoers" type="fix" due-to="Maytee Chinavanichkit">
- Add filter and remove filter were not working properly in AbstractFilterable.
- </action>
- <action issue="LOG4J2-1032" dev="rgoers" type="fix">
- Changed RenameAction to use java.nio to better report rename failures.
- </action>
- <action issue="LOG4J2-1407" dev="ggregory" type="fix">
- Fixed misleading WARN log events from Log4j about message factories and unexpected formatting.
- </action>
- <action issue="LOG4J2-1408" dev="ggregory" type="fix">
- Added the module log4j-liquibase to BOM POM.
- </action>
- <action issue="LOG4J2-1180" dev="ggregory" type="fix">
- 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.
- </action>
- <action issue="LOG4J2-1385" dev="ggregory" type="update">
- (GC) CSV layouts should not create a new CSVPrinter for each log event. Requires Apache Commons CSV 1.4.
- </action>
- <action issue="LOG4J2-1398" dev="ggregory" type="update">
- Update liquibase-core from 3.4.2 to 3.5.1.
- </action>
- <action issue="LOG4J2-1399" dev="ggregory" type="update">
- Update Apache Commons CSV from 1.3 to 1.4.
- </action>
- <action issue="LOG4J2-1411" dev="mattsicker" type="add">
- 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.
- </action>
- </release>
- <release version="2.6" date="2016-05-25" description="GA Release 2.6">
- <action issue="LOG4J2-1270" dev="rpopma" type="add">
- (GC) Added support for garbage-free logging in steady state.
- This includes Async Loggers and logging synchronously to the console and to a file,
- but does not include the AsyncAppender. This release makes the GelfLayout and
- the main patterns in the PatternLayout garbage-free.
- </action>
- <action issue="LOG4J2-1297" dev="rpopma" type="add">
- (GC) Added manual page on garbage-free logging.
- </action>
- <action issue="LOG4J2-1373" dev="rpopma" type="add">
- (GC) Update Logger wrapper Generator tool to generate methods for the new Logger methods.
- </action>
- <action issue="LOG4J2-1356" dev="mikes" type="update">
- (GC) GelfLayout does now support garabage-free logging (with compressionType=OFF).
- </action>
- <action issue="LOG4J2-1326" dev="rpopma" type="add">
- (GC) Added methods to the Logger interface for logging CharSequence messages.
- </action>
- <action issue="LOG4J2-1344" dev="rpopma" type="add">
- (GC) FileAppender, RollingFileAppender and MemoryMappedFileAppender are now also garbage-free by default.
- </action>
- <action issue="LOG4J2-1343" dev="rpopma" type="update">
- (GC) ConsoleAppender is now garbage-free by default. This logic is reusable for all AbstractOutputStreamAppender subclasses.
- </action>
- <action issue="LOG4J2-1278" dev="rpopma" type="add">
- (GC) Added unrolled varargs methods to Logger API, added Unbox utility to avoid auto-boxing when logging primitive values.
- </action>
- <action issue="LOG4J2-1318" dev="rpopma" type="update">
- (GC) Avoid allocating unnecessary temporary objects in LoggerContext's getLogger methods.
- </action>
- <action issue="LOG4J2-1333" dev="rpopma" type="update">
- (GC) Avoid allocating unnecessary temporary objects in MarkerManager's getMarker methods.
- </action>
- <action issue="LOG4J2-1321" dev="rpopma" type="update">
- (GC) Avoid allocating unnecessary temporary objects in PatternLayout's NamePatternConverter and ClassNamePatternConverter.
- </action>
- <action issue="LOG4J2-1271" dev="rpopma" type="add">
- (GC) Add MessageFactory that avoid allocation by reusing a cached ParameterizedMessage instance.
- </action>
- <action issue="LOG4J2-1271" dev="rpopma" type="update">
- (GC) ParameterizedMessage optimizations to avoid or at least postpone allocating temporary objects.
- </action>
- <action issue="LOG4J2-1283" dev="rpopma" type="update">
- (GC) Provide ThreadLocal-based gc-free caching mechanism in DatePatternConverter for non-webapps.
- </action>
- <action issue="LOG4J2-1293" dev="rpopma" type="add">
- (GC) Add interface StringBuilderFormattable to enable converting Messages and parameters to text without allocating temporary objects.
- ParameterizedMessage, ObjectMessage, SimpleMessage and ThreadDumpMessage now implement StringBuilderFormattable.
- </action>
- <action issue="LOG4J2-1291" dev="rpopma" type="update">
- (GC) Update PatternLayout to utilize gc-free mechanism for LogEvent processing.
- </action>
- <action issue="LOG4J2-1292" dev="rpopma" type="update">
- (GC) Update RandomAccessFileAppender and RollingRandomAccessFileAppender to utilize gc-free Layout.encode() method.
- </action>
- <action issue="LOG4J2-1274" dev="rpopma" type="add">
- (GC) Add encode(LogEvent, ByteBufferDestination) method to Layout API to enable converting LogEvents to bytes without creating temporary objects.
- </action>
- <action issue="LOG4J2-1281" dev="rpopma" type="fix">
- (GC) LoggerConfig.getProperties() should not allocate on each call.
- </action>
- <action issue="LOG4J2-1272" dev="rpopma" type="update">
- (GC) Improve LoggerConfig's data structure for AppenderControl objects to avoid allocating temporary objects during
- traversal for each log event.
- </action>
- <action issue="LOG4J2-1269" dev="rpopma" type="fix">
- (GC) AsyncLogger should use thread-local translator by default.
- </action>
- <action issue="LOG4J2-623" dev="rpopma" type="fix">
- Generate MDC properties as a JSON map in JSONLayout, with option to output as list of map entries.
- </action>
- <action issue="LOG4J2-1362" dev="rpopma" type="add" due-to="Gary Gregory">
- Added a YAML layout.
- </action>
- <action issue="LOG4J2-1387" dev="rpopma" type="fix">
- Fixed memory leak related to shutdown hook.
- </action>
- <action issue="LOG4J2-1179" dev="rpopma" type="add">
- Documented benchmark results comparing Log4j 2 performance to other logging libraries.
- </action>
- <action issue="LOG4J2-1382" dev="rpopma" type="fix">
- Copying a MutableLogEvent using Log4jLogEvent.Builder should not unnecessarily obtain caller location information.
- </action>
- <action issue="LOG4J2-1011" dev="mikes" type="add">
- Document dependencies for layouts.
- </action>
- <action issue="LOG4J2-621" dev="ggregory" type="add" due-to="Lee Theobald, Kamal Mettananda, Gary Gregory">
- Pattern to drop first N package parts.
- </action>
- <action issue="LOG4J2-494" dev="rgoers" type="add" due-to="Philipp Knobel">
- Support merging configurations to for a composite configuration.
- </action>
- <action issue="LOG4J2-1357" dev="mikes" type="add">
- Option to not log stack traces for logged Throwables in GelfLayout.
- </action>
- <action issue="LOG4J2-1375" dev="rpopma" type="update">
- Update SLF4J from 1.7.13 to 1.7.21.
- </action>
- <action issue="LOG4J2-1374" dev="rpopma" type="update">
- Migrate tests from Logback 1.1.3 to 1.1.7.
- </action>
- <action issue="LOG4J2-1384" dev="ggregory" type="update">
- Update Apache Commons CSV from 1.2 to 1.3.
- </action>
- <action issue="LOG4J2-1372" dev="rgoers" type="fix" due-to="Kamal Mettananda, Gary Gregory">
- XMLLayout indents, but not the first child tag (Event).
- </action>
- <action issue="LOG4J2-1363" dev="rgoers" type="fix">
- Properties Configuration did not support includeLocation attribute on Loggers.
- </action>
- <action issue="LOG4J2-1263" dev="rgoers" type="fix">
- The ConfigurationSource was not saved for BuiltConfigurations so monitor interval had no effect.
- </action>
- <action issue="LOG4J2-1369" dev="ggregory" type="fix" due-to="Alex Birch, Gary Gregory">
- "xz" compression results in plaintext, uncompressed files.
- </action>
- <action issue="LOG4J2-1365" dev="mikes" type="update">
- (Log4j-internal) Provide message text as CharSequence for some message types to optimize some layouts.
- </action>
- <action issue="LOG4J2-1368" dev="rpopma" type="fix">
- (Log4j-internal) StatusLogger dropped exceptions when logging parameterized messages.
- </action>
- <action issue="LOG4J2-1348" dev="ggregory" type="add" due-to="Greg Thomas, Gary Gregory">
- Add an AutoCloseable ThreadContext class: CloseableThreadContext.
- </action>
- <action issue="LOG4J2-1345" dev="rpopma" type="update">
- (Doc) Clarify documentation for properties that control Log4j behaviour.
- </action>
- <action issue="LOG4J2-1336" dev="ggregory" type="fix" due-to="Zbynek Vyskovsky">
- LoggerFactory in 1.2 API module is not compatible with 1.2.
- </action>
- <action issue="LOG4J2-1354" dev="ggregory" type="fix" due-to="Arkadiusz Adolph">
- No configuration reload is triggered under Windows when replacing the configuration file with one that has older last modified date.
- </action>
- <action issue="LOG4J2-1346" type="fix">
- Exception from Log4jServletContextListener prevents jetty-maven-plugin run-forked.
- </action>
- <action issue="LOG4J2-1339" dev="rpopma" type="fix">
- (Perf) AsyncLogger performance optimization: avoid calling instanceof TimestampMessage in hot path.
- </action>
- <action issue="LOG4J2-1324" dev="rpopma" type="fix">
- Improve error handling in the Async Logger background thread: the new default exception handler no longer rethrows the error.
- </action>
- <action issue="LOG4J2-1309" dev="ggregory" type="fix">
- Configuration file error does not show cause exception.
- </action>
- <action issue="LOG4J2-1299" dev="ggregory" type="add">
- Add pattern converter for thread id and priority in PatternLayout.
- </action>
- <action issue="LOG4J2-1289" dev="ggregory" type="fix">
- Change flow logging text from "entry' to "Enter" and "exit" to "Exit".
- </action>
- <action issue="LOG4J2-1284" dev="rpopma" type="fix">
- Made default MessageFactory configurable.
- </action>
- <action issue="LOG4J2-1280" dev="ggregory" type="fix">
- Deprecate org.apache.logging.log4j.util.MessageSupplier.
- </action>
- <action issue="LOG4J2-1280" dev="rpopma" type="fix">
- Logger methods taking Supplier parameters now correctly handle cases where the supplied value is a Message.
- </action>
- <action issue="LOG4J2-1268" dev="rpopma" type="fix">
- FixedDateFormat was incorrect for formats having MMM with the French locale.
- </action>
- <action issue="LOG4J2-1255" dev="rgoers" type="update">
- Add enhanced entry and exit methods.
- </action>
- <action issue="LOG4J2-124" dev="rgoers" type="add">
- Add shutdown methods to LogManager.
- </action>
- <action issue="LOG4J2-1222" dev="rgoers" type="fix">
- Creation of a LoggerContext will fail if shutdown is in progress. LogManager will default to SimpleLogger instead.
- </action>
- <action issue="LOG4J2-1221" dev="rpopma" type="add" due-to="Michael Barker">
- Added async logger Timeout wait strategy and made this the default wait strategy for async loggers.
- This prevents a rare deadlock that may occur on Solaris.
- </action>
- <action issue="LOG4J2-1080" dev="rpopma" type="add">
- Added option to discard events below a certain log level if the async logger ring buffer
- or async appender queue is full.
- </action>
- <action issue="LOG4J2-1237" dev="ggregory" type="add" due-to="Mike Calmus, Gary Gregory">
- Make PatternLayout header and footer accept a pattern.
- </action>
- <action issue="LOG4J2-1244" dev="ggregory" type="add" due-to="Anshu Garg, Remko Popma, Gary Gregory">
- Make header and footer values customizable in JSONLayout.
- </action>
- <action issue="LOG4J2-1245" dev="ggregory" type="add">
- Make CSV Layout header and footers accept patterns.
- </action>
- <action issue="LOG4J2-1192" dev="ggregory" type="add" due-to="J�rg Bretschneider, Gary Gregory">
- Dynamic Subject for SMTP Appender.
- </action>
- <action issue="LOG4J2-1277" dev="ggregory" type="add" due-to="Gary Gregory, Ludovic Hochet">
- FormattedMessage, MessageFormatMessage and StringFormattedMessage should support passing in a Locale to ensure appropriate formatting.
- </action>
- <action issue="LOG4J2-1260" dev="ggregory" type="fix" due-to="Blake Day, Gary Gregory">
- TlsSyslogFrame calculates message length incorrectly.
- </action>
- <action issue="LOG4J2-1258" dev="ggregory" type="fix" due-to="Francis Lalonde">
- Async DynamicThresholdFilter does not use the log event's context map.
- </action>
- <action issue="LOG4J2-1232" dev="ggregory" type="fix" due-to="Nikolai">
- Incorrect log rotation in last week of year.
- </action>
- <action issue="LOG4J2-1248" dev="rpopma" type="fix">
- Fixed broken nanotime in pattern layout.
- </action>
- <action issue="LOG4J2-908" dev="ggregory" type="fix" due-to="Konstantinos Liakos, Patrick Flaherty, Robin Coe, Gary Gregory">
- JSONLayout doesn't add a comma between log events.
- </action>
- <action issue="LOG4J2-1230" dev="ggregory" type="fix" due-to="Vladimir Hudec, Ralph Goers, Gary Gregory">
- Don't concatenate SYSLOG Messages.
- </action>
- <action issue="LOG4J2-1238" dev="ggregory" type="fix">
- org.apache.logging.log4j.core.net.TcpSocketManager and other classes does not report internal exceptions to the status logger.
- </action>
- <action issue="LOG4J2-1212" dev="rpopma" type="fix">
- Fix documentation to specify the correct default wait strategy used by async loggers.
- </action>
- <action issue="LOG4J2-1215" dev="ggregory" type="fix" due-to="Erik Kemperman">
- Documentation/XSD inconsistencies.
- </action>
- <action issue="LOG4J2-1276" dev="ggregory" type="fix" due-to="Ludovic Hochet">
- LoggerMessageSupplierTest and LoggerSupplierTest are Locale sensitive.
- </action>
- <action issue="LOG4J2-1380" dev="ggregory" type="update">
- Update Jackson from 2.7.3 to 2.7.4.
- </action>
- <action issue="LOG4J2-1304" dev="ggregory" type="update">
- Update Jackson from 2.7.0 to 2.7.2.
- </action>
- <action issue="LOG4J2-1253" dev="ggregory" type="update">
- Update LMAX Disruptor from 3.3.2 to 3.3.4.
- </action>
- <action issue="LOG4J2-1219" dev="ggregory" type="update">
- Update SLF4J from 1.7.12 to 1.7.13.
- </action>
- <action issue="LOG4J2-1239" dev="ggregory" type="update">
- Update Jackson from 2.6.3 to 2.6.4.
- </action>
- <action issue="LOG4J2-1249" dev="ggregory" type="update">
- Update Jackson from 2.6.4 to 2.7.0.
- </action>
- <action issue="LOG4J2-1351" dev="ggregory" type="update">
- Update Jackson from 2.7.2 to 2.7.3.
- </action>
- <action issue="LOG4J2-1240" dev="ggregory" type="update">
- Update Liquibase from 3.3.5 to 3.4.2.
- </action>
- <action issue="LOG4J2-1294" dev="ggregory" type="update">
- Update Kafka client from 0.9.0.0 to 0.9.0.1.
- </action>
- <action issue="LOG4J2-1352" dev="ggregory" type="update">
- Update javax.mail from 1.5.4 to 1.5.5.
- </action>
- <action issue="LOG4J2-1358" dev="ggregory" type="update">
- Update Apache Commons Compress from 1.10 to 1.11.
- </action>
- <action issue="LOG4J2-1388" dev="rpopma" type="update">
- Update Google java-allocation-instrumenter from 3.0 to 3.0.1.
- </action>
- <action issue="LOG4J2-1233" dev="ggregory" type="update" due-to="Bahri Gencsoy">
- Misleading Value In Properties Example.
- </action>
- <action issue="LOG4J2-1251" dev="mattsicker" type="fix" due-to="Romain Manni-Bucau">
- Fix JUL bridge issue where LogRecord.getParameters() is used when null.
- </action>
- <action issue="LOG4J2-1254" dev="rpopma" type="fix" due-to="Josh Trow">
- Fix typo in Flow Tracing documentation.
- </action>
- <action issue="LOG4J2-920" dev="mattsicker" type="fix" due-to="Ludovic Hochet">
- ClassNotFoundException for BundleContextSelector when initialising in an OSGi environment.
- </action>
- <action issue="LOG4J2-1300" dev="mattsicker" type="update">
- Remove serializability from classes that don't need it.
- </action>
- <action issue="LOG4J2-1303" dev="mattsicker" type="add">
- Add documentation links to runtime dependencies in each component intro page.
- </action>
- <action issue="LOG4J2-1275" dev="mattsicker" type="fix" due-to="Ludovic Hochet">
- Fix RollingAppenderNoUnconditionalDeleteTest repeat test runs from failing.
- </action>
- <action issue="LOG4J2-1262" dev="mattsicker" type="fix">
- Stop throwing unnecessary exception in Log4jServletContextListener.contextDestroyed().
- </action>
- <action issue="LOG4J2-1252" dev="mattsicker" type="add">
- JeroMqAppender should support layouts.
- </action>
- <action issue="LOG4J2-1227" dev="mattsicker" type="fix" due-to="Olivier Lemasle">
- NullPointerException in MapLookup.lookup if the event is null.
- </action>
- <action issue="LOG4J2-1306" dev="mattsicker" type="update">
- JeroMqAppender should use ShutdownCallbackRegistry instead of runtime hooks.
- </action>
- <action issue="LOG4J2-1217" dev="mattsicker" type="add" due-to="Thies Wellpott">
- PatternLayout option to limit length of text.
- </action>
- <action issue="LOG4J2-1308" dev="mattsicker" type="update">
- Remove need to pre-specify appender et al. identifiers in property file config format.
- </action>
- <action issue="LOG4J2-1050" dev="mattsicker" type="fix" due-to="Adam Retter">
- Add a Log4jLookup class to help write log files relative to log4j2.xml.
- </action>
- <action issue="LOG4J2-1133" dev="mattsicker" type="add">
- Add JNDI lookup documentation.
- </action>
- <action issue="LOG4J2-1310" dev="mattsicker" type="fix">
- JndiLookup mindlessly casts to String and should use String.valueOf().
- </action>
- <action issue="LOG4J2-1206" dev="mattsicker" type="update">
- org.apache.logging.log4j.core.LoggerContext#updateLoggers should call firePropertyChangeEvent.
- </action>
- <action issue="LOG4J2-248" dev="mattsicker" type="fix">
- Log4jWebInitializerImpl: Use Thread instead of Class for fallback classloader.
- </action>
- <action issue="LOG4J2-1169" dev="mattsicker" type="add" due-to="Gerald Kritzinger">
- PatternLayout: Possible variable substitution in equals substitution parameter.
- </action>
- <action issue="LOG4J2-1322" dev="mattsicker" type="update">
- Update Log4j 1.x migration guide to include information about system property lookup syntax changes.
- </action>
- <action issue="LOG4J2-1330" dev="mattsicker" type="fix">
- Fix NoClassDefFoundError in ReflectionUtil on Google App Engine.
- </action>
- </release>
- <release version="2.5" date="2015-12-06" description="GA Release 2.5">
- <action issue="LOG4J2-324" dev="rpopma" type="fix">
- Reduced memory usage of status messages in bounded queue; support zero-length queue that stores no messages.
- </action>
- <action issue="LOG4J2-1173" dev="rpopma" type="fix">
- Fixed rollover error when copying to a directory mapped to a remote Linux host.
- </action>
- <action issue="LOG4J2-435" dev="rpopma" type="add" due-to="Robert Schaft">
- Added support for custom delete actions triggered by a rollover.
- </action>
- <action issue="LOG4J2-649" dev="rgoers" type="update" due-to="Aleksey Zvolinsky">
- Add PurgePolicy and IdlePurgePolicy to RoutingAppender.
- </action>
- <action issue="LOG4J2-1202" dev="rgoers" type="update">
- Remove ConfigurationMonitor. The WatchManager is now used to check for configuration changes.
- </action>
- <action issue="LOG4J2-1195" dev="mikes" type="fix" due-to="Melvin Du">
- Make KafkaAppender support SerializedLayout.
- </action>
- <action issue="LOG4J2-89" dev="rgoers" type="add">
- Allow rollover to occur at any time. Add CronTriggeringPolicy.
- </action>
- <action issue="LOG4J2-381" dev="rgoers" type="fix" due-to="Anthony Baldocchi">
- Allow triggering policy and rollover strategy to be modified during reconfiguration.
- </action>
- <action issue="LOG4J2-1136" dev="rgoers" type="add">
- Add support for JSR 223 scripts in filters and the PatternSelector.
- </action>
- <action issue="LOG4J2-1168" dev="ggregory" type="add" due-to="Steven Swor">
- Add getters for source and destination file in file rename action.
- </action>
- <action issue="LOG4J2-1175" dev="ggregory" type="add">
- Add getters for classes in org.apache.logging.log4j.core.appender.rolling.action.
- </action>
- <action issue="LOG4J2-898" dev="rpopma" type="add">
- Added system property to allow users to control whether messages should be formatted in the background.
- </action>
- <action issue="LOG4J2-1178" dev="ggregory" type="add">
- Support use-case for JDBC's CommonDataSource.setLogWriter(PrintWriter) and java.sql.DriverManager.setLogWriter(PrintWriter).
- </action>
- <action issue="LOG4J2-1187" dev="ggregory" type="add">
- Support use case for java.sql.DriverManager.setLogStream(PrintStream).
- </action>
- <action issue="LOG4J2-1029" dev="rpopma" type="fix" due-to="Stefan Leonhartsberger">
- Performance improvement when gathering location information.
- </action>
- <action issue="LOG4J2-1172" dev="rpopma" type="fix">
- Fixed ThreadLocal leak [AsyncLogger$Info] on Tomcat when using AsyncLoggerContextSelector.
- </action>
- <action issue="LOG4J2-1176" dev="rpopma" type="fix">
- Fixed memory leak when log4j jars are in Tomcat's lib folder.
- </action>
- <action issue="LOG4J2-1180" dev="ggregory" type="fix" due-to="Mikael St�ldal">
- Logger cache does not account for message factory.
- </action>
- <action issue="LOG4J2-879" dev="rpopma" type="fix">
- Documentation: fixed minor issues with the site and manual pages.
- </action>
- <action issue="LOG4J2-999" dev="rpopma" type="fix" due-to="Joan Balaguer�">
- RollingFileAppender should also roll over when log event time is equal to rollover time, not only when later.
- </action>
- <action issue="LOG4J2-873" dev="rpopma" type="fix" due-to="Martin Dickins, LC, Luke Woodward">
- Fixed bug where omitting the <display-name> element in web.xml caused incorrect log4j initialization,
- resulting in memory leaks when the web application was stopped or reloaded.
- </action>
- <action issue="LOG4J2-323" dev="rpopma" type="fix">
- Better web app support for async loggers: Fixed a memory leak that occurred when the logging jars are placed
- in the container's classpath and the configuration file uses AsyncRoot/AsyncLogger.
- The problem was that the first web application started the Disruptor background thread [AsyncLoggerConfig-1] but did not stop it until all web apps are stopped.
- Each web application now has its own Disruptor which is stopped/started together with the web app.
- </action>
- <action issue="LOG4J2-493" dev="rpopma" type="fix">
- Better web app support for async loggers: it is now possible to place the logging jars in the container's
- classpath when making all loggers asynchronous by using AsyncLoggerContextSelector. This fixes a problem where
- logging would stop working after stopping and restarting a web application.
- </action>
- <action issue="LOG4J2-1171" dev="rpopma" type="fix">
- Use servlet context name for logger context name when available.
- </action>
- <action issue="LOG4J2-1159" dev="rpopma" type="fix">
- Fixed a ThreadLocal memory leak in Tomcat8 that mentions AsyncLoggers when Async Loggers are not used.
- </action>
- <action issue="LOG4J2-1166" dev="rpopma" type="fix">
- AbstractConfiguration executor should use a DaemonThreadFactory.
- </action>
- <action issue="LOG4J2-1165" dev="rpopma" type="fix">
- Improve Log4j initialization status messages.
- </action>
- <action issue="LOG4J2-1156" dev="rpopma" type="fix">
- Web site corrections and updates.
- </action>
- <action issue="LOG4J2-1158" dev="ggregory" type="fix" due-to="Michael Fortin, Gary Gregory">
- Log4J JUL adapter is using MessageFormat on String passed by java.util.function.Supplier<String>.
- </action>
- <action issue="LOG4J2-801" dev="mattsicker" type="fix">
- org.apache.logging.log4j.core.Logger should be serializable.
- </action>
- <action issue="LOG4J2-1157" dev="mattsicker" type="fix" due-to="Norbert Bartels">
- Fix compilation error for classes annotated with @Plugin.
- </action>
- <action issue="LOG4J2-948" dev="mattsicker" type="fix" due-to="Andrew Flower">
- Fix plugin documentation error about Converters.
- </action>
- <action issue="LOG4J2-1193" dev="ggregory" type="fix">
- Prefix all thread names Log4j creates with "Log4j2-".
- </action>
- <action issue="LOG4J2-1194" dev="ggregory" type="fix" due-to="Adam Brin">
- Documentation does not match parameters for LoggerNameLevelRewritePolicy.
- </action>
- <action issue="LOG4J2-1196" dev="mattsicker" type="fix" due-to="Ren� Zanner">
- MongoDbConnection does not close MongoClient.
- </action>
- <action issue="LOG4J2-1174" dev="ggregory" type="update">
- Update Jackson from 2.6.2 to 2.6.3.
- </action>
- <action issue="LOG4J2-1207" dev="ggregory" type="update">
- Update kafka-clients from 0.8.2.2 to 0.9.0.0.
- </action>
- </release>
- <release version="2.4.1" date="2015-10-08" description="GA Release 2.4.1">
- <action issue="LOG4J2-1129" dev="rgoers" type="add">
- Allow PatternLayout to select a pattern to use based on some selection criteria.
- </action>
- <action issue="LOG4J2-1145" dev="ggregory" type="add">
- Add %equals to PatternLayout to test and replace patterns with strings.
- </action>
- <action issue="LOG4J2-1147" dev="ggregory" type="add">
- Add %equalsIgnoreCase to PatternLayout to test and replace patterns with strings.
- </action>
- <action issue="LOG4J2-1146" dev="ggregory" type="add">
- Add %notEmpty to PatternLayout to avoid output of patterns where all variables are empty.
- </action>
- <action issue="LOG4J2-1020" dev="mikes" type="add">
- Add possibility to set shutdown timeout on AsyncAppender.
- </action>
- <action issue="LOG4J2-1153" dev="rpopma" type="fix">
- Fixed NullPointerException when only root logger is defined (and no named loggers) in configuration properties file.
- </action>
- <action issue="LOG4J2-1140" dev="rpopma" type="fix">
- Fixed bug where headers were not being written to first file with RollingFileAppender.
- </action>
- <action issue="LOG4J2-1149" dev="rpopma" type="fix">
- Fixed bug where PatternLayout predefined date pattern with time zone always renders default date format.
- </action>
- <action issue="LOG4J2-1050" dev="rpopma" type="fix">
- Fixed Log4jLookup.
- </action>
- <action issue="LOG4J2-1142" dev="rpopma" type="fix">
- Fix potential memory leak in web applications by using a straight ThreadLocal field instead of subclassing ThreadLocal.
- </action>
- <action issue="LOG4J2-1135" dev="rpopma" type="fix">
- Compression on rollover was broken: log file was renamed to .zip but not compressed.
- </action>
- <action issue="LOG4J2-1127" dev="ggregory" type="fix">
- log4j2.xml cannot be parsed on Oracle Weblogic 12c.
- </action>
- <action issue="LOG4J2-1132" dev="ggregory" type="fix">
- Do not use MongoDB driver 2.13.3 deprecated methods.
- </action>
- <action issue="LOG4J2-1144" dev="ggregory" type="fix">
- Add %markerSimpleName in pattern layout should evaluate to marker name (not toString()).
- </action>
- <action issue="LOG4J2-1126" dev="ggregory" type="fix">
- Web site corrections and updates.
- </action>
- <action issue="LOG4J2-1151" dev="rpopma" type="update">
- Performance improvement: backport Java 8 fast ISO-8859-1 String to byte[] encoder to AbstractStringLayout.
- </action>
- <action issue="LOG4J2-935" dev="rpopma" type="update">
- Performance improvement when converting Strings to byte[] arrays.
- </action>
- <action issue="LOG4J2-1040" dev="ggregory" type="update">
- Update MongoDB driver from 2.13.3 to 3.0.4.
- </action>
- <action issue="LOG4J2-1128" dev="ggregory" type="update">
- Reuse StringBuilder to improve performance for String-based layouts: CSV, GELF, HTML, RFC524, Syslog.
- </action>
- <action issue="LOG4J2-1131" dev="ggregory" type="update">
- Update mongo-java-driver from 2.13.2 to 2.13.3.
- </action>
- <action issue="LOG4J2-1138" dev="ggregory" type="update">
- Do not use Jackson deprecated methods.
- </action>
- <action issue="LOG4J2-1139" dev="ggregory" type="update">
- Update Jackson from 2.6.1 to 2.6.2.
- </action>
- <action issue="LOG4J2-1150" dev="ggregory" type="update">
- Update kafka-clients from 0.8.2.1 to 0.8.2.2.
- </action>
- </release>
- <release version="2.4" date="2015-09-20" description="GA Release 2.4">
- <action issue="LOG4J2-635" dev="rgoers" type="add">
- Add support for configuration via Properties.
- </action>
- <action issue="LOG4J2-952" dev="rgoers" type="add">
- Add ConfigurationBuilder for programmatic configuration.
- </action>
- <action issue="LOG4J2-1017" dev="ggregory" type="update">
- Update Java platform from Java 6 to 7. From this version onwards, log4j 2 requires Java 7.
- </action>
- <action issue="LOG4J2-599" dev="rpopma" type="add">
- Added support for Java 8 lambda expressions to lazily construct a log message only if
- the requested log level is enabled.
- </action>
- <action issue="LOG4J2-1118" dev="rpopma" type="add">
- Updated Logger wrapper generator tool to add Java 8 lambda support for custom log levels.
- </action>
- <action issue="LOG4J2-1107" dev="ggregory" type="add" due-to="Mikael St�ldal">
- New Appender for Apache Kafka.
- </action>
- <action issue="LOG4J2-1113" dev="ggregory" type="add" due-to="Gary Gregory">
- New publisher Appender for ZeroMQ (using JeroMQ).
- </action>
- <action issue="LOG4J2-1088" dev="ggregory" type="add" due-to="Gary Gregory">
- Add Comma Separated Value (CSV) layouts for parameter and event logging.
- </action>
- <action issue="LOG4J2-812" dev="rgoers" type="update">
- PatternLayout timestamp formatting performance improvement: replaced synchronized SimpleDateFormat with
- Apache Commons FastDateFormat. This and better caching resulted in a ~3-30X faster timestamp formatting.
- </action>
- <action issue="LOG4J2-1097" dev="rpopma" type="update">
- PatternLayout timestamp formatting performance improvement: predefined date formats (and variants using
- a period '.' millisecond separator instead of ',') are now formatted ~2-10X faster than other date formats.
- </action>
- <action issue="LOG4J2-1096" dev="rpopma" type="update">
- Improved performance of ParameterizedMessage::getFormattedMessage by ~2X.
- </action>
- <action issue="LOG4J2-1120" dev="rpopma" type="update">
- LoggerConfig performance improvements: avoid unnecessary lock acquisition, use more efficient data structure.
- </action>
- <action issue="LOG4J2-1125" dev="rpopma" type="update">
- PatternLayout performance improvement by caching and reusing a ThreadLocal StringBuilder.
- </action>
- <action issue="LOG4J2-1121" dev="rpopma" type="fix">
- Fixed potential race condition on reconfiguration. Introduced ReliabilityStrategy to facilitate
- switching between different mechanisms for preventing log events from being dropped on reconfiguration.
- </action>
- <action issue="LOG4J2-1114" dev="ggregory" type="update">
- Add thread name to status logger layout.
- </action>
- <action issue="LOG4J2-1123" dev="ggregory" type="fix">
- Core Configurator.initialize(String, ClassLoader, String) fails to work when config location is a file path.
- </action>
- <action issue="LOG4J2-1117" dev="ggregory" type="fix" due-to="Marcus Thiesen">
- OutputStreamManager in ConsoleAppender leaking managers.
- </action>
- <action issue="LOG4J2-1044" dev="rgoers" type="fix">
- Write pending events to Flume when the appender is stopped.
- </action>
- <action issue="LOG4J2-1108" dev="ggregory" type="fix" due-to="Mikael St�ldal">
- NullPointerException when passing null to java.util.logging.Logger.setLevel().
- </action>
- <action issue="LOG4J2-1110" dev="ggregory" type="fix">
- org.apache.logging.log4j.jul.CoreLogger.setLevel() checks for security permission too late.
- </action>
- <action dev="rpopma" type="remove">
- Removed experimental interface LevelLogger which got committed to master by mistake.
- </action>
- <action issue="LOG4J2-1010" dev="rgoers" type="update">
- Pass log event when interpolating logger properties.
- </action>
- <action issue="LOG4J2-1090" dev="ggregory" type="add">
- Add Core Configurator APIs to change a logger's level.
- </action>
- <action issue="LOG4J2-1105" dev="ggregory" type="add" due-to="Gary Gregory">
- Add API org.apache.logging.log4j.Level.isInRange(Level, Level).
- </action>
- <action issue="LOG4J2-1106" dev="ggregory" type="add" due-to="Gary Gregory">
- Add a LevelRangeFilter class.
- </action>
- <action issue="LOG4J2-1074" dev="rpopma" type="add">
- Added support for system nanosecond time in pattern layout.
- </action>
- <action issue="LOG4J2-1075" dev="rpopma" type="add">
- Added support for compressing to bzip2 format on file rollover.
- </action>
- <action issue="LOG4J2-1077" dev="ggregory" type="add">
- Support additional Apache Commons Compress compression formats on rollover: Deflate, Pack200, XY.
- </action>
- <action issue="LOG4J2-767" dev="ggregory" type="add" due-to="Mikael St�ldal">
- New module for Liquibase integration.
- </action>
- <action issue="LOG4J2-1023" dev="ggregory" type="add" due-to="Mikael St�ldal">
- New RewritePolicy for changing level of a log event.
- </action>
- <action issue="LOG4J2-1015" dev="ggregory" type="add" due-to="Daniel Marcotte">
- Add a way to route messages based on the %marker in Layout for RoutingAppender.
- </action>
- <action issue="LOG4J2-1050" dev="ggregory" type="add" due-to="Adam Retter">
- Add a Log4jLookup class to help write log files relative to log4j2.xml.
- </action>
- <action issue="LOG4J2-1057" dev="ggregory" type="add">
- Add API org.apache.logging.log4j.LogManager.getFormatterLogger().
- </action>
- <action issue="LOG4J2-1066" dev="ggregory" type="add" due-to="Charles Allen">
- Expose Log4jContextFactory's ShutdownCallbackRegistry.
- </action>
- <action issue="LOG4J2-1084" dev="ggregory" type="fix" due-to="Philipp Schneider">
- Misleading StatusLogger WARN event in LogManager with java.util.Map.
- </action>
- <action issue="LOG4J2-1051" dev="ggregory" type="fix" due-to="Lukasz Lenart">
- NoClassDefFoundError when starting app on Google App Engine.
- </action>
- <action issue="LOG4J2-684" dev="ggregory" type="fix" due-to="Joern Huxhorn, Mauro Molinari">
- ExtendedThrowablePatternConverter does not print suppressed exceptions.
- </action>
- <action issue="LOG4J2-1069" dev="ggregory" type="fix" due-to="Sam Braam">
- Improper handling of JSON escape chars when deserializing JSON log events.
- </action>
- <action issue="LOG4J2-1068" dev="ggregory" type="fix" due-to="Andy McMullan">
- Exceptions not logged when using TcpSocketServer + SerializedLayout.
- </action>
- <action issue="LOG4J2-1067" dev="ggregory" type="fix" due-to="Sam Braam">
- ThrowableProxy getExtendedStackTraceAsString throws NPE on deserialized nested exceptions.
- </action>
- <action issue="LOG4J2-1049" dev="rpopma" type="fix" due-to="Robert Schaft">
- AsyncAppender now resets the thread interrupted flag after catching InterruptedException.
- </action>
- <action issue="LOG4J2-1048" dev="rpopma" type="fix" due-to="Nikhil">
- FileConfigurationMonitor unnecessarily calls System.currentTimeMillis() causing high CPU usage.
- </action>
- <action issue="LOG4J2-1037" dev="ggregory" type="fix" due-to="Marc Dergacz">
- Backward compatibility issue in log4j-1.2-api NDC pop() and peek().
- </action>
- <action issue="LOG4J2-1025" dev="ggregory" type="fix" due-to="Mikael St�ldal">
- Custom java.util.logging.Level gives null Log4j Level and causes NPE.
- </action>
- <action issue="LOG4J2-1033" dev="ggregory" type="fix" due-to="Mikael St�ldal">
- SimpleLogger creates unnecessary Map objects by calling ThreadContext.getContext() instead of getImmutableContext().
- </action>
- <action issue="LOG4J2-1026" dev="ggregory" type="fix">
- HighlightConverter does not obey noConsoleNoAnsi.
- </action>
- <action issue="LOG4J2-1019" dev="ggregory" type="fix">
- ZipCompressAction leaves files open until GC when an IO error takes place.
- </action>
- <action issue="LOG4J2-1020" dev="ggregory" type="fix">
- GzCompressAction leaves files open until GC when an IO error takes place.
- </action>
- <action issue="LOG4J2-1038" dev="ggregory" type="fix" due-to="Gili">
- Incorrect documentation for layout default charset.
- </action>
- <action issue="LOG4J2-1042" dev="ggregory" type="fix" due-to="Guillaume Turri">
- Socket and Syslog appenders don't take timeout into account at startup.
- </action>
- <action issue="LOG4J2-934" dev="ggregory" type="fix" due-to="Kenneth Gendron">
- Circular suppressed Exception throws StackOverflowError.
- </action>
- <action issue="LOG4J2-1046" dev="ggregory" type="fix" due-to="Kenneth Gendron">
- Circular Exception cause throws StackOverflowError.
- </action>
- <action issue="LOG4J2-982" dev="ggregory" type="fix" due-to="Mikhail Mazurskiy">
- Use System.nanoTime() to measure time intervals.
- </action>
- <action issue="LOG4J2-1045" dev="ggregory" type="fix" due-to="G�nter Albrecht">
- Externalize log4j2.xml via URL resource.
- </action>
- <action issue="LOG4J2-1058" dev="ggregory" type="fix" due-to="Daniel Branzea">
- Log4jMarker#contains(String) does not respect org.slf4j.Marker contract.
- </action>
- <action issue="LOG4J2-1060" dev="ggregory" type="fix">
- Log4jMarker#contains(Marker) does not respect org.slf4j.Marker contract.
- </action>
- <action issue="LOG4J2-1061" dev="ggregory" type="fix">
- Log4jMarker#remove(Marker) does not respect org.slf4j.Marker contract.
- </action>
- <action issue="LOG4J2-1062" dev="ggregory" type="fix">
- Log4jMarker#add(Marker) does not respect org.slf4j.Marker contract.
- </action>
- <action issue="LOG4J2-1064" dev="ggregory" type="fix">
- org.apache.logging.slf4j.Log4jMarker does not implement org.slf4j.Marker.equals(Object) org.slf4j.Marker.hashCode().
- </action>
- <action issue="LOG4J2-889" dev="rpopma" type="fix" due-to="Maciej Kara\u015b, Kenneth Leider">
- Header in layout should not be written on application startup if appending to an existing file. Fixes LOG4J2-1030.
- </action>
- <action issue="LOG4J2-918" dev="rpopma" type="fix">
- Clarify documentation for combining async with sync loggers.
- </action>
- <action issue="LOG4J2-1078" dev="ggregory" type="fix" due-to="Mikael St�ldal">
- GelfLayout throws exception if some log event fields are null.
- </action>
- <action issue="LOG4J2-1044" dev="rgoers" type="update">
- Support batchSize in FlumeAvroManager.
- </action>
- <action issue="LOG4J2-1065" dev="ggregory" type="update">
- Define org.apache.logging.log4j.Marker.equals(Object) and org.apache.logging.log4j.Marker.hashCode().
- </action>
- <action issue="LOG4J2-1063" dev="ggregory" type="update">
- Avoid creating temporary array object in org.apache.logging.slf4j.Log4jMarker.iterator().
- </action>
- <action issue="LOG4J2-890" dev="ggregory" type="update" due-to="Hassan Kalaldeh, Robert Andersson, Remko Popma">
- log4j-web-2.1 should workaround a bug in JBOSS EAP 6.2.
- </action>
- <action issue="LOG4J2-403" dev="ggregory" type="update" due-to="Poorna Subhash P, Jeremy Lautman">
- MongoDB appender, username and password should be optional.
- </action>
- <action issue="LOG4J2-1035" dev="ggregory" type="update">
- Log4j2 tries to SystemClassLoader when running on Google AppEngine.
- </action>
- <action issue="LOG4J2-1022" dev="rgoers" type="update">
- Allow a list of keys to be specified in the MDC pattern converter.
- </action>
- <action issue="LOG4J2-959" dev="ggregory" type="update">
- Fix FindBugs DM_DEFAULT_ENCODING bug in SimpleLogger.logMessage() and simplify code.
- </action>
- <action issue="LOG4J2-1036" dev="ggregory" type="update">
- Update Apache Flume from 1.5.2 to 1.6.0.
- </action>
- <action issue="LOG4J2-1041" dev="ggregory" type="update">
- Update MongoDB driver from 2.11.2 to 2.13.2.
- </action>
- <action issue="LOG4J2-1018" dev="ggregory" type="update">
- Update database tests from H2 1.3.175 to 1.3.176.
- </action>
- <action issue="LOG4J2-1070" dev="ggregory" type="update">
- Update Java Mail from 1.5.2 to 1.5.4.
- </action>
- <action issue="LOG4J2-1079" dev="ggregory" type="update">
- Update Jackson from 2.5.3 to 2.5.4.
- </action>
- <action issue="LOG4J2-1879" dev="ggregory" type="update">
- Update Jackson from 2.5.4 to 2.6.0.
- </action>
- <action issue="LOG4J2-1092" dev="ggregory" type="update">
- Update Jackson from 2.6.0 to 2.6.1.
- </action>
- <action issue="LOG4J2-1104" dev="ggregory" type="update">
- Update Apache Commons Compress from 1.9 to 1.10.
- </action>
- </release>
- <release version="2.3" date="2015-05-09" description="GA Release 2.3">
- <action issue="LOG4J2-1009" dev="ggregory" type="fix" due-to="Mikael St�ldal">
- Incorrectly defined compressionType parameter to GelfLayout.
- </action>
- <action issue="LOG4J2-1008" dev="ggregory" type="fix" due-to="Ralph Goers, Gary Gregory">
- org.apache.logging.log4j.core.config.plugins.util.ResolverUtil.extractPath(URL) incorrectly converts '+' characters to spaces.
- </action>
- <action issue="LOG4J2-1007" dev="ggregory" type="fix" due-to="Ralph Goers, Gary Gregory">
- org.apache.logging.log4j.core.util#fileFromUri(URI uri) incorrectly converts '+' characters to spaces.
- </action>
- <action issue="LOG4J2-1003" dev="ggregory" type="fix" due-to="Dan Armbrust">
- JUL Logger.throwing is mis-mapped to ERROR when it should be TRACE.
- </action>
- <action issue="LOG4J2-965" dev="ggregory" type="fix" due-to="Khotyn Huang">
- System.out no longer works after the Console appender and JANSI are initialized.
- </action>
- <action issue="LOG4J2-998" dev="ggregory" type="update" due-to="Mariano Gonzalez">
- Make org.apache.logging.log4j.core.Logger#updateConfiguration protected.
- </action>
- <action issue="LOG4J2-995" dev="rgoers" type="update">
- Move UTF-8 constant from Charsets to Constants class. Remove Charsets class.
- </action>
- <action issue="LOG4J2-993" dev="rgoers" type="fix">
- Deadlock would occur if appender thread creates a new Logger during reconfiguration.
- </action>
- <action issue="LOG4J2-991" dev="rpopma" type="fix" due-to="Ryan Rupp">
- Async root logger config should default includeLocation to false.
- </action>
- <action issue="LOG4J2-985" dev="rpopma" type="fix" due-to="Sean Dawson">
- AbstractFilter should not implement equals() and hashCode().
- </action>
- <action issue="LOG4J2-984" dev="ggregory" type="add" due-to="Jonas H�pfner">
- PatternLayout %highlight to support noConsoleNoAnsi like %style.
- </action>
- <action issue="LOG4J2-926" dev="ggregory" type="add" due-to="David Ohana">
- Truncate from the end of text format modifier.
- </action>
- <action issue="LOG4J2-980" dev="ggregory" type="fix" due-to="Mikhail Mazurskiy">
- Numerical overflow in BurstFilter not handled correctly.
- </action>
- <action issue="LOG4J2-981" dev="ggregory" type="fix" due-to="Mikhail Mazurskiy">
- Incorrect unlock in ProviderUtil.
- </action>
- <action issue="LOG4J2-966" dev="ggregory" type="fix">
- KeyStoreConfiguration.createKeyStoreConfiguration() ignores keyManagerFactoryAlgorithm.
- </action>
- <action issue="LOG4J2-976" dev="ggregory" type="fix" due-to="Matt Quinn">
- Using monitorInterval with YAML config file format causes JSONParseException.
- </action>
- <action issue="LOG4J2-964" dev="ggregory" type="fix" due-to="Jonne Jyryl�">
- StringFormattedMessage serialization is incorrect.
- </action>
- <action issue="LOG4J2-947" dev="ggregory" type="fix" due-to="Stefan Wehner">
- A new StatusLoggerAdmin listener is added to StatusLogger every time the log is reconfigured.
- </action>
- <action issue="LOG4J2-968" dev="ggregory" type="fix" due-to="Paul D Johe">
- SyslogLayout contains extra space.
- </action>
- <action issue="LOG4J2-967" dev="ggregory" type="fix" due-to="Stefan Wehner">
- log4j2.component.properties not read for all properties.
- </action>
- <action issue="LOG4J2-971" dev="ggregory" type="fix" due-to="Paul D Johe">
- Another bad priority in Syslog messages.
- </action>
- <action issue="LOG4J2-972" dev="ggregory" type="fix">
- org.apache.logging.log4j.core.net.ssl.TlsSyslogInputStreamReader does not need to create temp Integer objects.
- </action>
- <action issue="LOG4J2-974" dev="ggregory" type="fix" due-to="Daniel Gal�n y Martins">
- Typo in EventLogger documentation.
- </action>
- <action issue="LOG4J2-988" dev="ggregory" type="update">
- Update LMAX Disruptor from 3.3.0 to 3.3.2.
- </action>
- <action issue="LOG4J2-987" dev="ggregory" type="update">
- Migrate tests from Logback 1.1.2 to 1.1.3.
- </action>
- <action issue="LOG4J2-988" dev="ggregory" type="update">
- Update tests to use ActiveMQ from 5.10 to 5.11.1.
- </action>
- <action issue="LOG4J2-1004" dev="ggregory" type="update">
- Update Jackson from 2.5.1 to 2.5.3.
- </action>
- <action issue="LOG4J2-1005" dev="ggregory" type="update">
- Update Slf4j from 1.7.7 to 1.7.12.
- </action>
- </release>
- <release version="2.2" date="2015-02-22" description="GA Release 2.2">
- <action issue="LOG4J2-938" dev="rpopma" type="fix" due-to="Mauro Molinari">
- (JMX) To avoid memory leaks when web applications are restarted, JMX notifications are sent from
- the caller thread in web applications. For non-web applications notifications are sent from a background thread
- as before.
- </action>
- <action issue="LOG4J2-957" dev="ggregory" type="fix" due-to="fatih guleryuz">
- Missing toUpperCase(Locale.ENGLISH).
- </action>
- <action issue="LOG4J2-956" dev="ggregory" type="fix" due-to="David Kellerman">
- Manual refers to Route "AppenderRef" attribute, should be "ref".
- </action>
- <action issue="LOG4J2-955" dev="rpopma" type="update">
- Documentation: clarify system properties to control status logger, improve troubleshooting FAQ entry.
- </action>
- <action issue="LOG4J2-950" dev="ggregory" type="update" due-to="Joel Edwards">
- Incorrect attribute name in PropertiesRewritePolicy example.
- </action>
- <action issue="LOG4J2-944" dev="ggregory" type="fix" due-to="Vinayaka Ramachandra">
- Log4j Flume appender is not adding millisecond to the event headers when the event is logged at 000 milliseconds.
- </action>
- <action issue="LOG4J2-941" dev="ggregory" type="add" due-to="Konstantinos Liakos">
- Allow JSON layout to create one compact log record per line.
- </action>
- <action issue="LOG4J2-933" dev="ggregory" type="add" due-to="ppiman at gmail.com">
- HTML layout should not use attribute minimalization for hr noshade.
- </action>
- <action issue="LOG4J2-895" dev="ggregory" type="add">
- Specify the SyslogAppender connect timeout value as part of the configuration.
- The SyslogAppender takes a new parameter connectTimeoutMillis.
- </action>
- <action issue="LOG4J2-899" dev="ggregory" type="add">
- Specify the SocketAppender connect timeout value as part of the configuration.
- The SyslogAppender takes a new parameter connectTimeoutMillis.
- </action>
- <action issue="LOG4J2-924" dev="ggregory" type="fix" due-to="Ryan Rupp">
- Log4j 1.2 Bridge doesn't map level ALL correctly in Category.getEffectiveLevel().
- </action>
- <action issue="LOG4J2-931" dev="ggregory" type="fix" due-to="Robert Gacki">
- ConsoleAppender is missing @PluginFactory annotation at createAppender method.
- </action>
- <action issue="LOG4J2-919" dev="ggregory" type="fix" due-to="David Johle">
- Logging system fails to initialize if XInclude API is not available.
- </action>
- <action issue="LOG4J2-914" dev="ggregory" type="fix" due-to="Kaj Bjurman">
- ThrowableProxy.getExtendedStackTraceAsString causes NullPointerException.
- </action>
- <action issue="LOG4J2-912" dev="ggregory" type="fix">
- XML configuration does not report full error message for XInclude parser configuration problems.
- </action>
- <action issue="LOG4J2-903" dev="ggregory" type="fix" due-to="Mauro Molinari">
- ClassLoaderContextSelector uses ClassLoader.toString() as a key
- </action>
- <action issue="LOG4J2-834" dev="ggregory" type="fix" due-to="Nikita Koval, Leonard Broman, Thiago Kronig">
- ThrowableProxy throws NoClassDefFoundError.
- </action>
- <action issue="LOG4J2-893" dev="ggregory" type="fix">
- NullPointerException on filter when mapping JUL to Log4j2.
- </action>
- <action issue="LOG4J2-892" dev="ggregory" type="fix">
- JUL adapter does not map Log4j'2 FATAL level to a JUL level.
- </action>
- <action issue="LOG4J2-881" dev="ggregory" type="fix" due-to="Mariano Gonzalez">
- AbstractLifecycle should not implement equals() and hashCode().
- </action>
- <action issue="LOG4J2-897" dev="ggregory" type="fix">
- Javadoc for org.apache.log4j.BasicConfigurator.configure() is incorrect.
- </action>
- <action issue="LOG4J2-891" dev="ggregory" type="fix">
- AbstractLifecycle should not implement equals() and hashCode().
- </action>
- <action issue="LOG4J2-946" dev="ggregory" type="fix" due-to="artemonster">
- [docs] Using Log4j 2 in Web Applications: Update example (Log4jWebLifeCycle is not visible).
- </action>
- <action issue="LOG4J2-901" dev="ggregory" type="update" due-to="Tihomir Me\u0161\u010di\u0107, Siegfried Greisinger">
- Update docs for SyslogAppender: "No structured id name was supplied"
- </action>
- <action issue="LOG4J2-958" dev="ggregory" type="update">
- Update from Jackson 2.5.0 to 2.5.1.
- </action>
- <action issue="LOG4J2-925" dev="ggregory" type="update">
- Update from Jackson 2.4.4 to 2.5.0.
- </action>
- <action issue="LOG4J2-910" dev="ggregory" type="update">
- Update Jackson from 2.4.3 to 2.4.4.
- </action>
- <action issue="LOG4J2-881" dev="ggregory" type="update">
- Update Jackson from 2.4.2 to 2.4.3.
- </action>
- <action issue="LOG4J2-882" dev="ggregory" type="update">
- Update maven-core from 3.1.0 to 3.2.3.
- </action>
- <action issue="LOG4J2-883" dev="ggregory" type="update">
- Update tests from org.apache.felix.framework 4.2.1 to 4.4.1.
- </action>
- <action issue="LOG4J2-884" dev="ggregory" type="update">
- Update org.eclipse.osgi from 3.6.0 to 3.7.1.
- </action>
- <action issue="LOG4J2-900" dev="ggregory" type="update">
- Update Apache Flume from 1.5.0.1 to 1.5.2.
- </action>
- </release>
- <release version="2.1" date="2014-10-19" description="GA Release 2.1">
- <action issue="LOG4J2-676" dev="rgoers" type="fix" due-to="Stefan Bodewig">
- Some typo fixes and enhancements for the site.
- </action>
- <action issue="LOG4J2-868" dev="mattsicker" type="add">
- Add ShutdownCallbackRegistry interface for customizable shutdown callback handling. This is particularly
- useful for application servers that wish to integrate with Log4j 2.
- </action>
- <action issue="LOG4J2-866" dev="rpopma" type="fix" due-to="Gerard Weatherby">
- Documentation: fixed missing closing parenthesis in code example.
- </action>
- <action issue="LOG4J2-862" dev="mattsicker" type="fix" due-to="Michael Sutherland">
- Fixed classloader issue that prevented Log4j from finding the implementation when used in a custom Ant task.
- </action>
- <action issue="LOG4J2-589" dev="rpopma" type="add">
- Supported filtering on custom log levels in configuration.
- </action>
- <action issue="LOG4J2-861" dev="rpopma" type="fix">
- Documentation: fix broken links on left navigation Extending Log4j Configuration sub-menu.
- </action>
- <action issue="LOG4J2-856" dev="rpopma" type="add">
- Documentation: add sections on the JUL Adapter, IO Streams and NoSQL Appenders to the Maven and Ivy page.
- </action>
- <action issue="LOG4J2-797" dev="rpopma" type="fix" due-to="Andreas Rytina">
- Documentation: clarified why log4j-core is a compile time dependency in Maven and Ivy page.
- </action>
- <action issue="LOG4J2-855" dev="rpopma" type="fix">
- Documentation: fix broken links on Appenders manual page.
- </action>
- <action issue="LOG4J2-807" dev="rpopma" type="fix">
- Prevent NPE when configuration with AsyncLogger/AsyncRoot is reloaded.
- </action>
- <action issue="LOG4J2-848" dev="ggregory" type="add">
- Add a Java lookup to provide nicely formatted runtime version information.
- </action>
- <action issue="LOG4J2-809" dev="mattsicker" type="add">
- Move reflection utility class to API's private utility classes.
- </action>
- <action issue="LOG4J2-845" dev="mattsicker" type="update">
- Add 2.1.0 to compatible versions in Log4j API ProviderUtil and update Log4jAPIVersion to 2.1.0 in
- core META-INF/log4j-provider.properties.
- </action>
- <action issue="LOG4J2-833" dev="rpopma" type="add">
- Documentation: added Runtime Dependencies link to left nav-bar on site.
- </action>
- <action issue="LOG4J2-816" dev="rpopma" type="add">
- Documentation: added section on XInclude to user manual Configuration page.
- </action>
- <action issue="LOG4J2-678" dev="rpopma" type="fix" due-to="Matt Sicker">
- Documentation: fixed minor issues with Log4j2 web site/documentation.
- </action>
- <action issue="LOG4J2-844" dev="rpopma" type="update">
- Update JMH to 1.1 from 0.7.2.
- </action>
- <action issue="LOG4J2-843" dev="rpopma" type="fix">
- Migrate JpaHyperSqlAppenderTest JUnit performance test to log4j-perf.
- </action>
- <action issue="LOG4J2-842" dev="rpopma" type="fix">
- Migrate JpaH2AppenderTest JUnit performance test to log4j-perf.
- </action>
- <action issue="LOG4J2-841" dev="rpopma" type="fix">
- Migrate JdbcHyperSqlAppenderTest JUnit performance test to log4j-perf.
- </action>
- <action issue="LOG4J2-840" dev="rpopma" type="fix">
- Migrate JdbcH2AppenderTest JUnit performance test to log4j-perf.
- </action>
- <action issue="LOG4J2-830" dev="rpopma" type="fix">
- Respect external interrupt signal to allow application shutdown after joining AsyncAppender thread.
- </action>
- <action issue="LOG4J2-813" dev="ggregory" type="fix" due-to="David Erichsen, Brandon Barry">
- MarkerManager Log4jMarker.hasParents() returns opposite of correct result.
- </action>
- <action issue="LOG4J2-785" dev="rpopma" type="fix">
- Documentation: fixed capitalization inconsistency in user manual example config.
- </action>
- <action issue="LOG4J2-829" dev="rpopma" type="fix">
- Fixed issue in RollingFile filePattern: backslashes are path separators, not escape characters.
- </action>
- <action issue="LOG4J2-547" dev="mattsicker" type="add">
- Add the Log4j IOStreams component.
- </action>
- <action issue="LOG4J2-431" dev="rpopma" type="add" due-to="Claude Mamo">
- Added Memory-Mapped File Appender.
- </action>
- <action issue="LOG4J2-832" dev="ggregory" type="fix" due-to="Seth Leger">
- ThrowableProxy fails if a class in logged stack trace throws java.lang.Error from initializer
- </action>
- <action issue="LOG4J2-831" dev="rpopma" type="update">
- Documentation: updated FAQ "which jars" diagrams for JUL bridge and 2.1 version.
- </action>
- <action issue="LOG4J2-827" dev="mattsicker" type="add">
- Support use of TypeConverter classes through the standard Plugin system.
- </action>
- <action issue="LOG4J2-745" dev="mattsicker" type="fix" due-to="Scott Harrington">
- Avoid ConverterKey plugin clashes by using a more predictable plugin loading infrastructure.
- Plugins have been segmented into three parts: class path, user-specified packages, and OSGi bundles.
- </action>
- <action issue="LOG4J2-798" dev="mattsicker" type="fix" due-to="Scott Harrington">
- Fixed plugin scanning redundancy causing massive slowdowns in certain environments.
- </action>
- <action issue="LOG4J2-753" dev="rpopma" type="fix">
- Reduced CachedClock thread contention.
- </action>
- <action issue="LOG4J2-819" dev="mattsicker" type="fix" due-to="Gary Gregory">
- Fixed memory leak in Tomcat 6 caused by clock background threads unintentionally
- started by Tomcat after web application stop.
- </action>
- <action issue="LOG4J2-825" dev="mattsicker" type="add">
- Add simple validation constraint annotations for the Plugin system.
- </action>
- <action issue="LOG4J2-428" dev="ggregory" type="add" due-to="Mark Paluch, Mikael St�ldal">
- Implement a GELF layout.
- </action>
- <action issue="LOG4J2-391" dev="rgoers" type="fix" due-to="Kamal Bahadur">
- FlumePersistentManager now handles LockConflictExceptions in Berkeley Db when sending a batch.
- </action>
- <action issue="LOG4J2-782" dev="mattsicker" type="fix">
- Remove invalid Oracle Maven repository.
- </action>
- <action issue="LOG4J2-780" dev="mattsicker" type="update">
- Update Spring Framework to 3.2.11.RELEASE from 3.2.8.RELEASE.
- </action>
- <action issue="LOG4J2-815" dev="mattsicker" type="update">
- Unify the two JMS appenders into a single appender. Configurations
<TRUNCATED>
[30/50] [abbrv] logging-log4j2 git commit: Removing bogus scm tag
element from POM
Posted by mi...@apache.org.
Removing bogus scm tag element from POM
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/aa037d30
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/aa037d30
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/aa037d30
Branch: refs/heads/LOG4J2-1390
Commit: aa037d30861db44208bc89bb87899fdc3a7d7fba
Parents: 4df3a6b
Author: Mikael St�ldal <mi...@magine.com>
Authored: Thu Oct 6 13:18:13 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Thu Oct 6 13:18:13 2016 +0200
----------------------------------------------------------------------
log4j-bom/pom.xml | 4 ----
1 file changed, 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/aa037d30/log4j-bom/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-bom/pom.xml b/log4j-bom/pom.xml
index 34745c4..6dee82f 100644
--- a/log4j-bom/pom.xml
+++ b/log4j-bom/pom.xml
@@ -141,8 +141,4 @@
</plugin>
</plugins>
</build>
-
- <scm>
- <tag>log4j-2.6.1</tag>
- </scm>
</project>
[34/50] [abbrv] logging-log4j2 git commit: Refactor use of
Strings.LINE_SEPARATOR.
Posted by mi...@apache.org.
Refactor use of Strings.LINE_SEPARATOR.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/118abf47
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/118abf47
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/118abf47
Branch: refs/heads/LOG4J2-1390
Commit: 118abf47142a3a7ea05d980aba8aded96df8d2f2
Parents: 2da9dfa
Author: Gary Gregory <gg...@apache.org>
Authored: Fri Oct 7 15:15:02 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Fri Oct 7 15:15:02 2016 -0700
----------------------------------------------------------------------
.../logging/log4j/core/layout/HtmlLayout.java | 77 +++++++++++---------
1 file changed, 44 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/118abf47/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java
index 67593e6..2acf335 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HtmlLayout.java
@@ -258,6 +258,16 @@ public final class HtmlLayout extends AbstractStringLayout {
}
}
+ private StringBuilder appendLs(StringBuilder sbuilder, String s) {
+ sbuilder.append(s).append(Strings.LINE_SEPARATOR);
+ return sbuilder;
+ }
+
+ private StringBuilder append(StringBuilder sbuilder, String s) {
+ sbuilder.append(s);
+ return sbuilder;
+ }
+
/**
* Returns appropriate HTML headers.
* @return The header as a byte array.
@@ -265,38 +275,39 @@ public final class HtmlLayout extends AbstractStringLayout {
@Override
public byte[] getHeader() {
final StringBuilder sbuf = new StringBuilder();
- sbuf.append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" ");
- sbuf.append("\"http://www.w3.org/TR/html4/loose.dtd\">");
- sbuf.append(Strings.LINE_SEPARATOR);
- sbuf.append("<html>").append(Strings.LINE_SEPARATOR);
- sbuf.append("<head>").append(Strings.LINE_SEPARATOR);
- sbuf.append("<meta charset=\"").append(getCharset()).append("\"/>").append(Strings.LINE_SEPARATOR);
- sbuf.append("<title>").append(title).append("</title>").append(Strings.LINE_SEPARATOR);
- sbuf.append("<style type=\"text/css\">").append(Strings.LINE_SEPARATOR);
- sbuf.append("<!--").append(Strings.LINE_SEPARATOR);
- sbuf.append("body, table {font-family:").append(font).append("; font-size: ");
- sbuf.append(headerSize).append(";}").append(Strings.LINE_SEPARATOR);
- sbuf.append("th {background: #336699; color: #FFFFFF; text-align: left;}").append(Strings.LINE_SEPARATOR);
- sbuf.append("-->").append(Strings.LINE_SEPARATOR);
- sbuf.append("</style>").append(Strings.LINE_SEPARATOR);
- sbuf.append("</head>").append(Strings.LINE_SEPARATOR);
- sbuf.append("<body bgcolor=\"#FFFFFF\" topmargin=\"6\" leftmargin=\"6\">").append(Strings.LINE_SEPARATOR);
- sbuf.append("<hr size=\"1\" noshade=\"noshade\">").append(Strings.LINE_SEPARATOR);
- sbuf.append("Log session start time " + new java.util.Date() + "<br>").append(Strings.LINE_SEPARATOR);
- sbuf.append("<br>").append(Strings.LINE_SEPARATOR);
- sbuf.append(
- "<table cellspacing=\"0\" cellpadding=\"4\" border=\"1\" bordercolor=\"#224466\" width=\"100%\">");
- sbuf.append(Strings.LINE_SEPARATOR);
- sbuf.append("<tr>").append(Strings.LINE_SEPARATOR);
- sbuf.append("<th>Time</th>").append(Strings.LINE_SEPARATOR);
- sbuf.append("<th>Thread</th>").append(Strings.LINE_SEPARATOR);
- sbuf.append("<th>Level</th>").append(Strings.LINE_SEPARATOR);
- sbuf.append("<th>Logger</th>").append(Strings.LINE_SEPARATOR);
+ append(sbuf, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" ");
+ appendLs(sbuf, "\"http://www.w3.org/TR/html4/loose.dtd\">");
+ appendLs(sbuf, "<html>");
+ appendLs(sbuf, "<head>");
+ append(sbuf, "<meta charset=\"");
+ append(sbuf, getCharset().toString());
+ appendLs(sbuf, "\"/>");
+ append(sbuf, "<title>").append(title);
+ appendLs(sbuf, "</title>");
+ appendLs(sbuf, "<style type=\"text/css\">");
+ appendLs(sbuf, "<!--");
+ append(sbuf, "body, table {font-family:").append(font).append("; font-size: ");
+ appendLs(sbuf, headerSize).append(";}");
+ appendLs(sbuf, "th {background: #336699; color: #FFFFFF; text-align: left;}");
+ appendLs(sbuf, "-->");
+ appendLs(sbuf, "</style>");
+ appendLs(sbuf, "</head>");
+ appendLs(sbuf, "<body bgcolor=\"#FFFFFF\" topmargin=\"6\" leftmargin=\"6\">");
+ appendLs(sbuf, "<hr size=\"1\" noshade=\"noshade\">");
+ appendLs(sbuf, "Log session start time " + new java.util.Date() + "<br>");
+ appendLs(sbuf, "<br>");
+ appendLs(sbuf,
+ "<table cellspacing=\"0\" cellpadding=\"4\" border=\"1\" bordercolor=\"#224466\" width=\"100%\">");
+ appendLs(sbuf, "<tr>");
+ appendLs(sbuf, "<th>Time</th>");
+ appendLs(sbuf, "<th>Thread</th>");
+ appendLs(sbuf, "<th>Level</th>");
+ appendLs(sbuf, "<th>Logger</th>");
if (locationInfo) {
- sbuf.append("<th>File:Line</th>").append(Strings.LINE_SEPARATOR);
+ appendLs(sbuf, "<th>File:Line</th>");
}
- sbuf.append("<th>Message</th>").append(Strings.LINE_SEPARATOR);
- sbuf.append("</tr>").append(Strings.LINE_SEPARATOR);
+ appendLs(sbuf, "<th>Message</th>");
+ appendLs(sbuf, "</tr>");
return sbuf.toString().getBytes(getCharset());
}
@@ -307,9 +318,9 @@ public final class HtmlLayout extends AbstractStringLayout {
@Override
public byte[] getFooter() {
final StringBuilder sbuf = new StringBuilder();
- sbuf.append("</table>").append(Strings.LINE_SEPARATOR);
- sbuf.append("<br>").append(Strings.LINE_SEPARATOR);
- sbuf.append("</body></html>");
+ appendLs(sbuf, "</table>");
+ appendLs(sbuf, "<br>");
+ appendLs(sbuf, "</body></html>");
return getBytes(sbuf.toString());
}
[21/50] [abbrv] logging-log4j2 git commit: [maven-release-plugin]
prepare for next development iteration
Posted by mi...@apache.org.
[maven-release-plugin] prepare for next development iteration
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/3176c96d
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/3176c96d
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/3176c96d
Branch: refs/heads/LOG4J2-1390
Commit: 3176c96d96360d9702751d941f82832d8ff9030a
Parents: 29cfc80
Author: rgoers <ra...@dslextreme.com>
Authored: Sun Oct 2 11:13:19 2016 -0700
Committer: rgoers <ra...@dslextreme.com>
Committed: Sun Oct 2 11:13:19 2016 -0700
----------------------------------------------------------------------
log4j-1.2-api/pom.xml | 2 +-
log4j-api-scala_2.10/pom.xml | 2 +-
log4j-api-scala_2.11/pom.xml | 2 +-
log4j-api/pom.xml | 2 +-
log4j-bom/pom.xml | 4 ++--
log4j-core/pom.xml | 2 +-
log4j-distribution/pom.xml | 2 +-
log4j-flume-ng/pom.xml | 2 +-
log4j-iostreams/pom.xml | 2 +-
log4j-jcl/pom.xml | 2 +-
log4j-jmx-gui/pom.xml | 2 +-
log4j-jul/pom.xml | 2 +-
log4j-liquibase/pom.xml | 2 +-
log4j-nosql/pom.xml | 2 +-
log4j-perf/pom.xml | 2 +-
log4j-samples/configuration/pom.xml | 2 +-
log4j-samples/flume-common/pom.xml | 2 +-
log4j-samples/flume-embedded/pom.xml | 2 +-
log4j-samples/flume-remote/pom.xml | 2 +-
log4j-samples/loggerProperties/pom.xml | 2 +-
log4j-samples/pom.xml | 2 +-
log4j-samples/scala-api/pom.xml | 2 +-
log4j-slf4j-impl/pom.xml | 2 +-
log4j-taglib/pom.xml | 2 +-
log4j-to-slf4j/pom.xml | 2 +-
log4j-web/pom.xml | 2 +-
pom.xml | 4 ++--
27 files changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-1.2-api/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/pom.xml b/log4j-1.2-api/pom.xml
index 2704c5b..98b6716 100644
--- a/log4j-1.2-api/pom.xml
+++ b/log4j-1.2-api/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-1.2-api</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-api-scala_2.10/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-api-scala_2.10/pom.xml b/log4j-api-scala_2.10/pom.xml
index c11b66b..46edf74 100644
--- a/log4j-api-scala_2.10/pom.xml
+++ b/log4j-api-scala_2.10/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-api-scala_2.10</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-api-scala_2.11/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-api-scala_2.11/pom.xml b/log4j-api-scala_2.11/pom.xml
index f8b5288..4a7ba19 100644
--- a/log4j-api-scala_2.11/pom.xml
+++ b/log4j-api-scala_2.11/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-api-scala_2.11</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-api/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-api/pom.xml b/log4j-api/pom.xml
index 9f0b641..debeb2f 100644
--- a/log4j-api/pom.xml
+++ b/log4j-api/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-api</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-bom/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-bom/pom.xml b/log4j-bom/pom.xml
index f3f8540..34745c4 100644
--- a/log4j-bom/pom.xml
+++ b/log4j-bom/pom.xml
@@ -26,7 +26,7 @@
<description>Apache Log4j Bill of Materials</description>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-bom</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
@@ -143,6 +143,6 @@
</build>
<scm>
- <tag>log4j-2.7-rc2</tag>
+ <tag>log4j-2.6.1</tag>
</scm>
</project>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-core/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml
index 4774f50..2fbc78c 100644
--- a/log4j-core/pom.xml
+++ b/log4j-core/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-core</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-distribution/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-distribution/pom.xml b/log4j-distribution/pom.xml
index 2a3ca59..6544b74 100644
--- a/log4j-distribution/pom.xml
+++ b/log4j-distribution/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-distribution</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-flume-ng/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-flume-ng/pom.xml b/log4j-flume-ng/pom.xml
index 89324d8..06bb7b5 100644
--- a/log4j-flume-ng/pom.xml
+++ b/log4j-flume-ng/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-flume-ng</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-iostreams/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-iostreams/pom.xml b/log4j-iostreams/pom.xml
index 5fdac1f..c818aae 100644
--- a/log4j-iostreams/pom.xml
+++ b/log4j-iostreams/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-iostreams</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-jcl/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-jcl/pom.xml b/log4j-jcl/pom.xml
index e6ac09c..0b6bd72 100644
--- a/log4j-jcl/pom.xml
+++ b/log4j-jcl/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-jcl</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-jmx-gui/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-jmx-gui/pom.xml b/log4j-jmx-gui/pom.xml
index eda3674..97b743a 100644
--- a/log4j-jmx-gui/pom.xml
+++ b/log4j-jmx-gui/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-jmx-gui</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-jul/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-jul/pom.xml b/log4j-jul/pom.xml
index 13bcf91..ca161cd 100644
--- a/log4j-jul/pom.xml
+++ b/log4j-jul/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-liquibase/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-liquibase/pom.xml b/log4j-liquibase/pom.xml
index 7242ce2..7d2d66c 100644
--- a/log4j-liquibase/pom.xml
+++ b/log4j-liquibase/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-liquibase</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-nosql/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-nosql/pom.xml b/log4j-nosql/pom.xml
index b19ce43..ccf44e9 100644
--- a/log4j-nosql/pom.xml
+++ b/log4j-nosql/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-perf/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-perf/pom.xml b/log4j-perf/pom.xml
index 8a2af25..a027651 100644
--- a/log4j-perf/pom.xml
+++ b/log4j-perf/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-samples/configuration/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-samples/configuration/pom.xml b/log4j-samples/configuration/pom.xml
index 2501f36..153a394 100644
--- a/log4j-samples/configuration/pom.xml
+++ b/log4j-samples/configuration/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j-samples</artifactId>
<groupId>org.apache.logging.log4j.samples</groupId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
</parent>
<artifactId>log4j-samples-configuration</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-samples/flume-common/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-samples/flume-common/pom.xml b/log4j-samples/flume-common/pom.xml
index 9f3b2a8..73e7975 100644
--- a/log4j-samples/flume-common/pom.xml
+++ b/log4j-samples/flume-common/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j-samples</artifactId>
<groupId>org.apache.logging.log4j.samples</groupId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
</parent>
<artifactId>log4j-samples-flume-common</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-samples/flume-embedded/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-samples/flume-embedded/pom.xml b/log4j-samples/flume-embedded/pom.xml
index 350c4d9..368424d 100644
--- a/log4j-samples/flume-embedded/pom.xml
+++ b/log4j-samples/flume-embedded/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j-samples</artifactId>
<groupId>org.apache.logging.log4j.samples</groupId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
</parent>
<artifactId>log4j-samples-flume-embedded</artifactId>
<packaging>war</packaging>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-samples/flume-remote/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-samples/flume-remote/pom.xml b/log4j-samples/flume-remote/pom.xml
index 7e6dad3..4c487f5 100644
--- a/log4j-samples/flume-remote/pom.xml
+++ b/log4j-samples/flume-remote/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j-samples</artifactId>
<groupId>org.apache.logging.log4j.samples</groupId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
</parent>
<artifactId>log4j-samples-flume-remote</artifactId>
<packaging>war</packaging>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-samples/loggerProperties/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-samples/loggerProperties/pom.xml b/log4j-samples/loggerProperties/pom.xml
index 0547075..5a4e14c 100644
--- a/log4j-samples/loggerProperties/pom.xml
+++ b/log4j-samples/loggerProperties/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j-samples</artifactId>
<groupId>org.apache.logging.log4j.samples</groupId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
</parent>
<artifactId>log4j-samples-loggerProperties</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-samples/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-samples/pom.xml b/log4j-samples/pom.xml
index f4876fc..654c93e 100644
--- a/log4j-samples/pom.xml
+++ b/log4j-samples/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<groupId>org.apache.logging.log4j.samples</groupId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-samples/scala-api/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-samples/scala-api/pom.xml b/log4j-samples/scala-api/pom.xml
index 30e6051..d2d3203 100644
--- a/log4j-samples/scala-api/pom.xml
+++ b/log4j-samples/scala-api/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j-samples</artifactId>
<groupId>org.apache.logging.log4j.samples</groupId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
</parent>
<artifactId>log4j-samples-scala-api</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-slf4j-impl/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-slf4j-impl/pom.xml b/log4j-slf4j-impl/pom.xml
index d962dd5..a788d67 100644
--- a/log4j-slf4j-impl/pom.xml
+++ b/log4j-slf4j-impl/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-slf4j-impl</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-taglib/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-taglib/pom.xml b/log4j-taglib/pom.xml
index fb5fdcd..55f76a3 100644
--- a/log4j-taglib/pom.xml
+++ b/log4j-taglib/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-taglib</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-to-slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-to-slf4j/pom.xml b/log4j-to-slf4j/pom.xml
index eb45f64..e95de69 100644
--- a/log4j-to-slf4j/pom.xml
+++ b/log4j-to-slf4j/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-to-slf4j</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/log4j-web/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-web/pom.xml b/log4j-web/pom.xml
index 2dc469a..22dd052 100644
--- a/log4j-web/pom.xml
+++ b/log4j-web/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3176c96d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e9b8da6..a32f984 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
<artifactId>log4j</artifactId>
<packaging>pom</packaging>
<name>Apache Log4j 2</name>
- <version>2.7</version>
+ <version>2.7.1-SNAPSHOT</version>
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
@@ -173,7 +173,7 @@
<connection>scm:git:http://git-wip-us.apache.org/repos/asf/logging-log4j2.git</connection>
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/logging-log4j2.git</developerConnection>
<url>https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;a=summary</url>
- <tag>log4j-2.7-rc2</tag>
+ <tag>log4j-${Log4jReleaseVersion}</tag>
</scm>
<organization>
<name>Apache Software Foundation</name>
[25/50] [abbrv] logging-log4j2 git commit: Merge branch 'master' into
LOG4J2-1623
Posted by mi...@apache.org.
Merge branch 'master' into LOG4J2-1623
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/94465257
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/94465257
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/94465257
Branch: refs/heads/LOG4J2-1390
Commit: 94465257cc0e2c3645ce08a72c1dbb64b63ae282
Parents: 2153a26 ce86130
Author: Mikael St�ldal <mi...@magine.com>
Authored: Wed Oct 5 13:01:28 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Wed Oct 5 13:01:28 2016 +0200
----------------------------------------------------------------------
BUILDING.txt | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
[23/50] [abbrv] logging-log4j2 git commit: Update BUILDING.txt file
for building the site and out of memory problems.
Posted by mi...@apache.org.
Update BUILDING.txt file for building the site and out of memory
problems.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/ce861303
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/ce861303
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/ce861303
Branch: refs/heads/LOG4J2-1390
Commit: ce861303981bc6a2630800b2d9449b3eebd7acb2
Parents: 3176c96
Author: Gary Gregory <gg...@apache.org>
Authored: Mon Oct 3 18:37:13 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Mon Oct 3 18:37:13 2016 -0700
----------------------------------------------------------------------
BUILDING.txt | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ce861303/BUILDING.txt
----------------------------------------------------------------------
diff --git a/BUILDING.txt b/BUILDING.txt
index bce02f7..9d5f3f8 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -26,6 +26,10 @@ mvn clirr:check -pl log4j-1.2-api
Next, to build the site:
+If Java 7 runs out of memory building the site, you will need:
+
+set MAVEN_OPTS=-Xmx2000m -XX:MaxPermSize=384m
+
mvn site
On Windows, use a local staging directory, for example:
[43/50] [abbrv] logging-log4j2 git commit: Fix Javadoc
Posted by mi...@apache.org.
Fix Javadoc
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/22369ccf
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/22369ccf
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/22369ccf
Branch: refs/heads/LOG4J2-1390
Commit: 22369ccf073f1a27c5ba858f39161194693bda0f
Parents: 19418b3
Author: Mikael St�ldal <mi...@magine.com>
Authored: Thu Oct 20 15:13:48 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Thu Oct 20 15:13:48 2016 +0200
----------------------------------------------------------------------
.../java/org/apache/logging/log4j/core/ContextDataInjector.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/22369ccf/log4j-core/src/main/java/org/apache/logging/log4j/core/ContextDataInjector.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/ContextDataInjector.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/ContextDataInjector.java
index 65b9a76..5351245 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/ContextDataInjector.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/ContextDataInjector.java
@@ -76,7 +76,7 @@ public interface ContextDataInjector {
* ThreadContextDataInjector.copyProperties(properties, reusable);
*
* // then copy context data key-value pairs (may overwrite configuration properties)
- * reusable.addAll(rawContextData());
+ * reusable.putAll(rawContextData());
* return reusable;
* }
* </pre>
@@ -102,7 +102,7 @@ public interface ContextDataInjector {
* underlying context may or may not be reflected in the returned object, depending on the context data source and
* the implementation of this method. It is not safe to pass the returned object to another thread.
* </p>
- * @return a {@code ReadOnlyStringMap} object reflecting the current state of the context
+ * @return a {@code ReadOnlyStringMap} object reflecting the current state of the context, may not return {@code null}
*/
ReadOnlyStringMap rawContextData();
}
[40/50] [abbrv] logging-log4j2 git commit: Use try-with-resources.
Posted by mi...@apache.org.
Use try-with-resources.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/197997ac
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/197997ac
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/197997ac
Branch: refs/heads/LOG4J2-1390
Commit: 197997ac35217369cdcc881c258cfcbd5db6a258
Parents: 8245e54
Author: ggregory <gg...@US-L-GG02.rocketsoftware.com>
Authored: Mon Oct 10 14:21:49 2016 -0700
Committer: ggregory <gg...@US-L-GG02.rocketsoftware.com>
Committed: Mon Oct 10 14:21:49 2016 -0700
----------------------------------------------------------------------
.../java/org/apache/logging/log4j/core/lookup/JndiLookup.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/197997ac/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/JndiLookup.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/JndiLookup.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/JndiLookup.java
index 35c4f9d..3dbef43 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/JndiLookup.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/JndiLookup.java
@@ -50,15 +50,12 @@ public class JndiLookup extends AbstractLookup {
return null;
}
final String jndiName = convertJndiName(key);
- final JndiManager jndiManager = JndiManager.getDefaultManager();
- try {
+ try (final JndiManager jndiManager = JndiManager.getDefaultManager()) {
final Object value = jndiManager.lookup(jndiName);
return value == null ? null : String.valueOf(value);
} catch (final NamingException e) {
LOGGER.warn(LOOKUP, "Error looking up JNDI resource [{}].", jndiName, e);
return null;
- } finally {
- jndiManager.close();
}
}
[31/50] [abbrv] logging-log4j2 git commit: Adding links to Scaladoc
Posted by mi...@apache.org.
Adding links to Scaladoc
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/2da9dfa6
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/2da9dfa6
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/2da9dfa6
Branch: refs/heads/LOG4J2-1390
Commit: 2da9dfa67e478c8ceb9c0362bad388576e05859b
Parents: aa037d3
Author: Mikael St�ldal <mi...@magine.com>
Authored: Thu Oct 6 13:29:05 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Thu Oct 6 13:29:05 2016 +0200
----------------------------------------------------------------------
src/site/site.xml | 1 +
src/site/xdoc/javadoc.xml | 4 ++++
2 files changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2da9dfa6/src/site/site.xml
----------------------------------------------------------------------
diff --git a/src/site/site.xml b/src/site/site.xml
index cd23f6e..b99af21 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -40,6 +40,7 @@
<item name="Implementation" href="/log4j-core/apidocs/index.html" />
<item name="JSP Tag Library" href="/log4j-taglib/apidocs/index.html" />
<item name="JSP Tag Library (TLD Doc)" href="/log4j-taglib/tlddoc/index.html" />
+ <item name="Scala API (Scaladoc)" href="/log4j-api-scala_2.11/scaladocs/index.html#org.apache.logging.log4j.scala.package" />
</item>
<item name="Runtime Dependencies" href="/runtime-dependencies.html"/>
<item name="Articles" href="/articles.html"/>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2da9dfa6/src/site/xdoc/javadoc.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/javadoc.xml b/src/site/xdoc/javadoc.xml
index 7708c14..32b6b7c 100644
--- a/src/site/xdoc/javadoc.xml
+++ b/src/site/xdoc/javadoc.xml
@@ -55,6 +55,10 @@
<td><a href="log4j-taglib/tlddoc/index.html">JSP Tag Library (TLD Doc)</a></td>
<td>The special Javadoc-like Tag Library Documentation for the Log4j 2 JSP Tag Library.</td>
</tr>
+ <tr>
+ <td><a href="log4j-api-scala_2.11/scaladocs/index.html#org.apache.logging.log4j.scala.package">Scala API (Scaladoc)</a></td>
+ <td>The Scala wrapper for the Log4j API.</td>
+ </tr>
</table>
<p>
[33/50] [abbrv] logging-log4j2 git commit: LOG4J2-1623 Fix Javadoc
Posted by mi...@apache.org.
LOG4J2-1623 Fix Javadoc
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6482da5b
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6482da5b
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6482da5b
Branch: refs/heads/LOG4J2-1390
Commit: 6482da5b325a8d42bc79ade754a1d5b904c6dcea
Parents: 3064471
Author: Mikael St�ldal <mi...@magine.com>
Authored: Thu Oct 6 13:42:17 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Thu Oct 6 13:42:17 2016 +0200
----------------------------------------------------------------------
.../log4j/core/config/builder/api/ConfigurationBuilder.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6482da5b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java
index b115651..8141c25 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/builder/api/ConfigurationBuilder.java
@@ -369,9 +369,14 @@ public interface ConfigurationBuilder<T extends Configuration> extends Builder<T
ConfigurationBuilder<T> setShutdownHook(String flag);
/**
- * Specifies how long time appenders and other plugins will get to shutdown when the JVM shuts down.
- * Default is zero. (Not used if {@link #setShutdownHook(String)} is set to "disable".)
+ * How long appenders and background tasks will get to shutdown when the JVM shuts down.
+ * Default is zero which mean that each appender uses its default timeout, and don't wait for background
+ * tasks. Not all appenders will honor this, it is a hint and not an absolute guarantee that the shutdown
+ * procedure will not take longer. Setting this too low increase the risk of losing outstanding log events
+ * not yet written to the final destination. (Not used if {@link #setShutdownHook(String)} is set to "disable".)
* @return this builder instance.
+ *
+ * @see LoggerContext#stop(long, TimeUnit)
*/
ConfigurationBuilder<T> setShutdownTimeout(long timeout, TimeUnit timeUnit);
[38/50] [abbrv] logging-log4j2 git commit: [LOG4J2-1639 ]Fix
MemoryMappedFileAppender.createAppender() Javadoc for immediateFlush.
Posted by mi...@apache.org.
[LOG4J2-1639 ]Fix MemoryMappedFileAppender.createAppender() Javadoc for
immediateFlush.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/fc0e07c2
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/fc0e07c2
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/fc0e07c2
Branch: refs/heads/LOG4J2-1390
Commit: fc0e07c23c23a1a12dd379a7c96cadf9d05f7d35
Parents: d65bf73
Author: ggregory <gg...@US-L-GG02.rocketsoftware.com>
Authored: Mon Oct 10 13:39:43 2016 -0700
Committer: ggregory <gg...@US-L-GG02.rocketsoftware.com>
Committed: Mon Oct 10 13:39:43 2016 -0700
----------------------------------------------------------------------
.../logging/log4j/core/appender/MemoryMappedFileAppender.java | 2 +-
src/changes/changes.xml | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/fc0e07c2/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java
index f12e8b2..1c8e0d2 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java
@@ -122,7 +122,7 @@ public final class MemoryMappedFileAppender extends AbstractOutputStreamAppender
* "true".
* @param name The name of the Appender.
* @param immediateFlush "true" if the contents should be flushed on every write, "false" otherwise. The default is
- * "true".
+ * "false".
* @param regionLengthStr The buffer size, defaults to {@value MemoryMappedFileManager#DEFAULT_REGION_LENGTH}.
* @param ignore If {@code "true"} (default) exceptions encountered when appending events are logged; otherwise they
* are propagated to the caller.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/fc0e07c2/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 659440d..3288f97 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -27,6 +27,9 @@
<action issue="LOG4J2-1636" dev="ggregory" type="fix" due-to="Eldar Gabdullin">
Console Appender does not pick up Oracle Java 8's sun.stdout.encoding and sun.stderr.encoding.
</action>
+ <action issue="LOG4J2-1639" dev="ggregory" type="fix" due-to="Sridhar Gopinath">
+ Fix MemoryMappedFileAppender.createAppender() Javadoc for immediateFlush.
+ </action>
</release>
<release version="2.7" date="2016-10-02" description="GA Release 2.7">
<action issue="LOG4J2-1618" dev="rpopma" type="fix" due-to="Raman Gupta">
[36/50] [abbrv] logging-log4j2 git commit: [LOG4J2-1636] Console
Appender does not pick up Oracle Java 8's sun.stdout.encoding and
sun.stderr.encoding. This is a partial fix. See discussion in Jira.
Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d65bf73c/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index cd2f379..659440d 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -1,3085 +1,3090 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set sw=2: -->
-<!--
- 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.
--->
-<document xmlns="http://maven.apache.org/changes/1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/xsd/changes-1.0.0.xsd">
- <properties>
- <title>Changes</title>
- </properties>
- <body>
- <release version="2.7" date="2016-10-02" description="GA Release 2.7">
- <action issue="LOG4J2-1618" dev="rpopma" type="fix" due-to="Raman Gupta">
- Fixed ClassCastException when using JUL logging during shutdown.
- </action>
- <action issue="LOG4J2-1620" dev="ggregory" type="fix" due-to="Sascha Scholz">
- 2.7-rc1: RollingFileAppender immediateFlush default value should be true, not false.
- </action>
- <action issue="LOG4J2-1611" dev="rpopma" type="fix">
- Improved performance of context data injector for web applications to be on par with standalone applications.
- </action>
- <action issue="LOG4J2-1591" dev="rpopma" type="fix">
- Introduced new interface LifeCycle2 with stop(long,TimeUnit) method to avoid breaking backwards compatibility with new Configurator.shutdown(LoggerContext, long, TimeUnit) API.
- </action>
- <action issue="LOG4J2-1590" dev="rpopma" type="fix">
- Fixed issue with filters extending AbstractFilter that did not override methods with unrolled varargs.
- </action>
- <action issue="LOG4J2-1583" dev="rpopma" type="fix" due-to="Larry West">
- Fixed scrambled log messages triggered by nested logging from toString() method of a logging parameter object.
- </action>
- <action issue="LOG4J2-1259" dev="ggregory" type="fix" due-to="Misagh Moayyed, Steffen Offermann">
- Log4j threads are no longer leaking on Tomcat shutdown.
- </action>
- <action issue="LOG4J2-1051" dev="rpopma" type="fix" due-to="Lukasz Lenart">
- When starting on Google App Engine, Interpolator now suppresses the NoClassDefFoundError stack trace for the jvmrunargs lookup.
- </action>
- <action issue="LOG4J2-1582" dev="rpopma" type="fix">
- When initializing on platforms where JMX is not available, Interpolator component no longer prints stack trace for warning messages.
- </action>
- <action issue="LOG4J2-1581" dev="rpopma" type="fix">
- Unregistering JMX components no longer prints a stack trace when the MBean has already been unregistered.
- </action>
- <action issue="LOG4J2-1313" dev="rpopma" type="fix" due-to="Philipp Knobel, Leon Finker">
- Support Property values to be specified in configuration as a value attribute as well as an element.
- </action>
- <action issue="LOG4J2-1575" dev="rpopma" type="fix">
- (GC) LoggerConfig now stores configuration properties in a List, not a Map to prevent creating temporary Iterator objects. Added method LoggerConfig#getPropertyList(), deprecated method #getProperties().
- </action>
- <action issue="LOG4J2-1457" dev="mattsicker" type="fix" due-to="Leon Finker">
- 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">
- 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">
- 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.
- </action>
- <action issue="LOG4J2-1542" dev="rpopma" type="fix" due-to="Rog�rio Lecari�o Leite">
- Prevent ArrayIndexOutOfBoundsException in ParameterizedMessage.formatTo for single-char or empty messages.
- </action>
- <action issue="LOG4J2-1549" dev="mikes" type="fix" due-to="Jason Bedard">
- Fixed issue where AsyncLoggerContextSelector+PropertiesConfigurationBuilder defaulted to includeLocation=true.
- </action>
- <action issue="LOG4J2-1562" dev="ggregory" type="fix">
- 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">
- Prevent NPE in Level.isInRange.
- </action>
- <action issue="LOG4J2-1511" dev="ggregory" type="fix" due-to="Srikanth Surukuntu">
- DynamicThresholdFilter filtered incorrectly when params were passed as individual arguments instead of varargs.
- </action>
- <action issue="LOG4J2-1548" dev="ggregory" type="fix">
- [CronTriggeringPolicy] ConfigurationScheduler scheduled the task infinitely after first fire.
- </action>
- <action issue="LOG4J2-1506" dev="ggregory" type="fix" due-to="Johannes Schleger">
- 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">
- 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">
- 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">
- Prevent NPE when dynamically removing filters.
- </action>
- <action issue="LOG4J2-1532" dev="ggregory" type="fix">
- Attributes were not merged properly in composite configurations.
- </action>
- <action issue="LOG4J2-1529" dev="mattsicker" type="fix" due-to="Sridevi Narra">
- 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="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">
- 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 failed with an NPE when comparing Nodes with different attributes.
- </action>
- <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">
- Documented that JVM Input Arguments Lookup (JMX) is not available on Google App Engine.
- </action>
- <action issue="LOG4J2-1438" dev="rpopma" type="fix">
- (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.
- </action>
- <action issue="LOG4J2-1489" dev="rpopma" type="fix" due-to="Richard Zschech">
- (GC) Fixed %date conversion patterns with a timezone parameter are now garbage free.
- </action>
- <action issue="LOG4J2-1279" dev="rpopma" type="fix" due-to="Tony Baines">
- Prevent NullPointerException in FastDateParser$TimeZoneStrategy.
- </action>
- <action issue="LOG4J2-1341" dev="rpopma" type="fix" due-to="Richard Zschech">
- (GC) HighlightConverter and StyleConverter are now GC-free.
- </action>
- <action issue="LOG4J2-1467" dev="rpopma, ggregory" type="fix" due-to="Ralf, Gary Gregory">
- [OSGi] Fixed missing import package.
- </action>
- <action issue="LOG4J2-351" dev="rpopma, ggregory" type="fix" due-to="Roland Weiglhofer">
- [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 was not working correctly.
- </action>
- <action issue="LOG4J2-1502" dev="ggregory" type="fix" due-to="Sumit Singhal">
- Fixed issue where CsvParameterLayout and CsvLogEventLayout inserted NUL characters if data starts with {, (, [ or "
- </action>
- <action issue="LOG4J2-1573" dev="ggregory" type="fix" due-to="Steffen Offermann">
- Layout is no longer optional.
- </action>
- <action issue="LOG4J2-1608" dev="ggregory" type="fix">
- ServletAppender does not provide throwable object to ServletContext.
- </action>
- <action issue="LOG4J2-1599" dev="ggregory" type="fix">
- Prevent potential NPE in org.apache.logging.log4j.message.ParameterFormatter.formatMessage3(StringBuilder, char[], int, Object[], int, int[]).
- </action>
- <action issue="LOG4J2-1600" dev="ggregory" type="fix">
- Prevent potential NPE due to org.apache.logging.log4j.core.layout.MarkerPatternSelector.createSelector(PatternMatch[], String, boolean, boolean, Configuration).
- </action>
- <action issue="LOG4J2-1601" dev="ggregory" type="fix">
- Prevent potential NPE due to org.apache.logging.log4j.core.layout.ScriptPatternSelector.createSelector(AbstractScript, PatternMatch[], String, boolean, boolean, Configuration).
- </action>
- <action issue="LOG4J2-1602" dev="ggregory" type="fix">
- Prevent potential NPE in org.apache.logging.log4j.core.util.datetime.FormatCache.MultipartKey.equals(Object) when object is null.
- </action>
- <action issue="LOG4J2-1603" dev="ggregory" type="fix">
- Redo hashCode() and equals() methods in org.apache.logging.log4j.core.net.ssl classes.
- </action>
- <action issue="LOG4J2-1610" dev="ggregory" type="fix" due-to="Shubhankar">
- Add targetNamespace to log4j-config.xsd. GitHub #43.
- </action>
- <action issue="LOG4J2-1619" dev="ggregory" type="fix">
- new Log4jLogEvent().toString() throws an NPE.
- </action>
- <action issue="LOG4J2-1578" dev="ggregory" type="add">
- RoutingAppender can be configured with scripts. Add Script in a Routes element.
- </action>
- <action issue="LOG4J2-1597" dev="ggregory" type="add">
- Add a ScriptAppenderSelector to create an Appender specified by a Script.
- </action>
- <action issue="LOG4J2-1349" dev="rpopma" type="add">
- (GC) Added support for garbage-free ThreadContext map. Disabled by default, users need to enable this explicitly.
- </action>
- <action issue="LOG4J2-1447" dev="rpopma" type="add">
- (GC) Changed LogEvent's internal data structure for context data to be garbage-free. Added method LogEvent#getContextData(), deprecated method #getContextMap().
- </action>
- <action issue="LOG4J2-1010" dev="rpopma" type="add" due-to="Mikael St�ldal">
- Users can now inject context data from other sources than ThreadContext. Values can be any Object, not just Strings.
- </action>
- <action issue="LOG4J2-1568" dev="mattsicker" type="add">
- Added support for java.util.concurrent.LinkedTransferQueue to AsyncAppender.
- </action>
- <action issue="LOG4J2-1430" dev="mattsicker" type="add" due-to="John Cairns">
- Added optional support for Conversant DisruptorBlockingQueue in AsyncAppender.
- </action>
- <action issue="LOG4J2-1439" dev="mattsicker" type="add" due-to="Anthony Maire">
- Added optional support for JCTools MPSC bounded lock-free queue in AsyncAppender.
- </action>
- <action issue="LOG4J2-1558" dev="ggregory" type="add">
- SocketAppender now supports IO buffering.
- </action>
- <action issue="LOG4J2-1557" dev="ggregory" type="add">
- Add a Builder for the SocketAppender (deprecates factory method).
- </action>
- <action issue="LOG4J2-1609" dev="ggregory" type="add">
- Add a Builder to ServletAppender and deprecate factory method.
- </action>
- <action issue="LOG4J2-1553" dev="ggregory" type="add">
- AbstractManager now implements AutoCloseable.
- </action>
- <action issue="LOG4J2-1528" dev="mikes" type="add">
- Added ability to generate Log4j 2-style XML configuration file from ConfigurationBuilder.
- </action>
- <action issue="LOG4J2-1181" dev="mikes" type="add">
- Added Logging API for Scala 2.10 and 2.11.
- </action>
- <action issue="LOG4J2-1512" dev="mikes" type="add">
- Added options to exclude stack trace from JSON, XML and YAML layouts.
- </action>
- <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">
- FileAppender is now able to create files on-demand.
- </action>
- <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">
- [PatternLayout] Add an ANSI option to %xThrowable.
- </action>
- <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">
- [PatternLayout] Add an ANSI option to %message.
- </action>
- <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">
- Allow Builders to be completely generic.
- </action>
- <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<String, String>).
- </action>
- <action issue="LOG4J2-1519" dev="ggregory" type="add">
- Add ThreadContext.putAll(Map<String, String>).
- </action>
- <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">
- The Core AbstractConfiguration now tracks its LoggerContext and add Configuration.getLoggerContext().
- </action>
- <action issue="LOG4J2-1540" dev="ggregory" type="add">
- The Core AbstractManager now tracks its LoggerContext.
- </action>
- <action issue="LOG4J2-1577" dev="ggregory" type="add">
- Add a Builder to the RoutingAppender and deprecate factory method.
- </action>
- <action issue="LOG4J2-1604" dev="ggregory" type="update" due-to="Colin Hillman">
- Log4j2 TcpSocketServer in background.
- </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 now extend Log4jThread.
- </action>
- <action issue="LOG4J2-1605" dev="ggregory" type="update">
- Improve error messages for TcpSocketServer and UdpSocketServer.
- </action>
- <action issue="LOG4J2-1458" dev="ggregory" type="update">
- Updated Jackson from 2.7.5 to 2.8.0.
- </action>
- <action issue="LOG4J2-1494" dev="ggregory" type="update">
- Updated Jackson from 2.8.0 to 2.8.1.
- </action>
- <action issue="LOG4J2-1569" dev="ggregory" type="update">
- Updated Jackson from 2.8.1 to 2.8.2.
- </action>
- <action issue="LOG4J2-1598" dev="ggregory" type="update">
- Updated Jackson from 2.8.2 to 2.8.3.
- </action>
- <action issue="LOG4J2-1495" dev="ggregory" type="update">
- Updated LMAX Disruptor from 3.3.4 to 3.3.5.
- </action>
- <action issue="LOG4J2-1496" dev="ggregory" type="update">
- Updated Kafka client from 0.9.1.0 to 0.10.0.0.
- </action>
- <action issue="LOG4J2-1533" dev="ggregory" type="update">
- Updated Kafka client from 0.10.0.0 to 0.10.0.1.
- </action>
- <action issue="LOG4J2-1487" dev="ggregory" type="update">
- Updated JMS test from ActiveMQ 5.13.3 to 5.13.4.
- </action>
- <action issue="LOG4J2-1551" dev="ggregory" type="update">
- Updated JMS test from ActiveMQ 5.13.4 to 5.14.0.
- </action>
- <action issue="LOG4J2-1543" dev="ggregory" type="update">
- Removed deprecated Core API org.apache.logging.log4j.core.util.Constants.UTF_8.
- </action>
- <action issue="LOG4J2-1544" dev="ggregory" type="update">
- Removed deprecated Core API org.apache.logging.log4j.core.util.Assert.requireNonNull(T, String).
- </action>
- <action issue="LOG4J2-1545" dev="ggregory" type="update">
- 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">
- <action issue="LOG4J2-904" dev="rgoers" type="fix" due-to="Bernhard M�hr">
- If copy and delete fails in rename action then resort to truncating the source file after copying it.
- </action>
- <action issue="LOG4J2-1250" dev="rgoers" type="fix">
- CronTriggeringPolicy was not properly setting the prevFileTime value for the PatternProcessor so
- file dates and times on rolled files were incorrect.
- </action>
- <action issue="LOG4J2-1452" dev="rpopma" type="fix" due-to="Mikael St�ldal">
- Fixed issue where reusable messages broke flow tracing logic.
- </action>
- <action issue="LOG4J2-1440" dev="rgoers" type="fix">
- Fix bug in OnStartupTriggeringPolicy that allowed it to roll over on every reconfiguration. Added
- minSize attribute.
- </action>
- <action issue="LOG4J2-1414" dev="rpopma" type="fix" due-to="Ralph Goers">
- Fixed minor issues with the 2.6.1 web site.
- </action>
- <action issue="LOG4J2-1434" dev="rpopma" type="fix" due-to="Luke Butters">
- Ensure that the thread-local StringBuilders used by Layouts to format log events to text will not
- retain excessive memory after a large message was logged.
- </action>
- <action issue="LOG4J2-1395" dev="mikes" type="add">
- Add "direct" option to ConsoleAppender for increased performance.
- </action>
- <action issue="LOG4J2-1418" dev="mikes" type="fix">
- Provide MessageFactory2 to custom Logger implementations.
- </action>
- <action issue="LOG4J2-1420" dev="rgoers" type="fix">
- RollingRandomAccessFileManager was not properly rolling over on startup and was getting a NullPointerException.
- </action>
- <action issue="LOG4J2-1417" dev="rpopma" type="fix">
- Fixed issue where Unbox utility ignored the value Constants.ENABLE_THREADLOCALS and always stored non-JDK classes in ThreadLocals.
- </action>
- <action issue="LOG4J2-1422" dev="rpopma" type="fix">
- Fixed issue where AsyncAppenderQueueFullPolicyTest sometimes hangs.
- </action>
- <action issue="LOG4J2-1445" dev="ggregory" type="fix" due-to="Ludovic HOCHET">
- OnStartupTriggeringPolicyTest fails on Windows saying the file is used by another process.
- </action>
- <action issue="LOG4J2-1437" dev="rpopma" type="add">
- (GC) ObjectMessage and ReusableObjectMessage now avoid calling toString() on auto-boxed primitive parameters.
- </action>
- <action issue="LOG4J2-1415" dev="rpopma" type="add">
- (GC) ParameterFormatter now avoids calling toString() on auto-boxed primitive message parameters.
- </action>
- <action issue="LOG4J2-1412" dev="rpopma" type="add">
- Unbox utility's ringbuffer of StringBuilders is now configurable.
- </action>
- <action issue="LOG4J2-1432" dev="ggregory" type="update">
- Update Jackson from 2.7.4 to 2.7.5.
- </action>
- <action issue="LOG4J2-1433" dev="ggregory" type="update">
- Update Jansi from 1.11 to 1.13.
- </action>
- <action issue="LOG4J2-1444" dev="ggregory" type="update">
- Update Apache Commons Compress from 1.11 to 1.12.
- </action>
- </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.
- </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.
- </action>
- <action issue="LOG4J2-1409" dev="rpopma" type="fix" due-to="Shahan">
- Fixed ArrayIndexOutOfBoundsException that may occur in ReusableParameterizedMessage.
- </action>
- <action issue="LOG4J2-997" dev="rgoers" type="fix" due-to="Maytee Chinavanichkit">
- Add filter and remove filter were not working properly in AbstractFilterable.
- </action>
- <action issue="LOG4J2-1032" dev="rgoers" type="fix">
- Changed RenameAction to use java.nio to better report rename failures.
- </action>
- <action issue="LOG4J2-1407" dev="ggregory" type="fix">
- Fixed misleading WARN log events from Log4j about message factories and unexpected formatting.
- </action>
- <action issue="LOG4J2-1408" dev="ggregory" type="fix">
- Added the module log4j-liquibase to BOM POM.
- </action>
- <action issue="LOG4J2-1180" dev="ggregory" type="fix">
- 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.
- </action>
- <action issue="LOG4J2-1385" dev="ggregory" type="update">
- (GC) CSV layouts should not create a new CSVPrinter for each log event. Requires Apache Commons CSV 1.4.
- </action>
- <action issue="LOG4J2-1398" dev="ggregory" type="update">
- Update liquibase-core from 3.4.2 to 3.5.1.
- </action>
- <action issue="LOG4J2-1399" dev="ggregory" type="update">
- Update Apache Commons CSV from 1.3 to 1.4.
- </action>
- <action issue="LOG4J2-1411" dev="mattsicker" type="add">
- 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.
- </action>
- </release>
- <release version="2.6" date="2016-05-25" description="GA Release 2.6">
- <action issue="LOG4J2-1270" dev="rpopma" type="add">
- (GC) Added support for garbage-free logging in steady state.
- This includes Async Loggers and logging synchronously to the console and to a file,
- but does not include the AsyncAppender. This release makes the GelfLayout and
- the main patterns in the PatternLayout garbage-free.
- </action>
- <action issue="LOG4J2-1297" dev="rpopma" type="add">
- (GC) Added manual page on garbage-free logging.
- </action>
- <action issue="LOG4J2-1373" dev="rpopma" type="add">
- (GC) Update Logger wrapper Generator tool to generate methods for the new Logger methods.
- </action>
- <action issue="LOG4J2-1356" dev="mikes" type="update">
- (GC) GelfLayout does now support garabage-free logging (with compressionType=OFF).
- </action>
- <action issue="LOG4J2-1326" dev="rpopma" type="add">
- (GC) Added methods to the Logger interface for logging CharSequence messages.
- </action>
- <action issue="LOG4J2-1344" dev="rpopma" type="add">
- (GC) FileAppender, RollingFileAppender and MemoryMappedFileAppender are now also garbage-free by default.
- </action>
- <action issue="LOG4J2-1343" dev="rpopma" type="update">
- (GC) ConsoleAppender is now garbage-free by default. This logic is reusable for all AbstractOutputStreamAppender subclasses.
- </action>
- <action issue="LOG4J2-1278" dev="rpopma" type="add">
- (GC) Added unrolled varargs methods to Logger API, added Unbox utility to avoid auto-boxing when logging primitive values.
- </action>
- <action issue="LOG4J2-1318" dev="rpopma" type="update">
- (GC) Avoid allocating unnecessary temporary objects in LoggerContext's getLogger methods.
- </action>
- <action issue="LOG4J2-1333" dev="rpopma" type="update">
- (GC) Avoid allocating unnecessary temporary objects in MarkerManager's getMarker methods.
- </action>
- <action issue="LOG4J2-1321" dev="rpopma" type="update">
- (GC) Avoid allocating unnecessary temporary objects in PatternLayout's NamePatternConverter and ClassNamePatternConverter.
- </action>
- <action issue="LOG4J2-1271" dev="rpopma" type="add">
- (GC) Add MessageFactory that avoid allocation by reusing a cached ParameterizedMessage instance.
- </action>
- <action issue="LOG4J2-1271" dev="rpopma" type="update">
- (GC) ParameterizedMessage optimizations to avoid or at least postpone allocating temporary objects.
- </action>
- <action issue="LOG4J2-1283" dev="rpopma" type="update">
- (GC) Provide ThreadLocal-based gc-free caching mechanism in DatePatternConverter for non-webapps.
- </action>
- <action issue="LOG4J2-1293" dev="rpopma" type="add">
- (GC) Add interface StringBuilderFormattable to enable converting Messages and parameters to text without allocating temporary objects.
- ParameterizedMessage, ObjectMessage, SimpleMessage and ThreadDumpMessage now implement StringBuilderFormattable.
- </action>
- <action issue="LOG4J2-1291" dev="rpopma" type="update">
- (GC) Update PatternLayout to utilize gc-free mechanism for LogEvent processing.
- </action>
- <action issue="LOG4J2-1292" dev="rpopma" type="update">
- (GC) Update RandomAccessFileAppender and RollingRandomAccessFileAppender to utilize gc-free Layout.encode() method.
- </action>
- <action issue="LOG4J2-1274" dev="rpopma" type="add">
- (GC) Add encode(LogEvent, ByteBufferDestination) method to Layout API to enable converting LogEvents to bytes without creating temporary objects.
- </action>
- <action issue="LOG4J2-1281" dev="rpopma" type="fix">
- (GC) LoggerConfig.getProperties() should not allocate on each call.
- </action>
- <action issue="LOG4J2-1272" dev="rpopma" type="update">
- (GC) Improve LoggerConfig's data structure for AppenderControl objects to avoid allocating temporary objects during
- traversal for each log event.
- </action>
- <action issue="LOG4J2-1269" dev="rpopma" type="fix">
- (GC) AsyncLogger should use thread-local translator by default.
- </action>
- <action issue="LOG4J2-623" dev="rpopma" type="fix">
- Generate MDC properties as a JSON map in JSONLayout, with option to output as list of map entries.
- </action>
- <action issue="LOG4J2-1362" dev="rpopma" type="add" due-to="Gary Gregory">
- Added a YAML layout.
- </action>
- <action issue="LOG4J2-1387" dev="rpopma" type="fix">
- Fixed memory leak related to shutdown hook.
- </action>
- <action issue="LOG4J2-1179" dev="rpopma" type="add">
- Documented benchmark results comparing Log4j 2 performance to other logging libraries.
- </action>
- <action issue="LOG4J2-1382" dev="rpopma" type="fix">
- Copying a MutableLogEvent using Log4jLogEvent.Builder should not unnecessarily obtain caller location information.
- </action>
- <action issue="LOG4J2-1011" dev="mikes" type="add">
- Document dependencies for layouts.
- </action>
- <action issue="LOG4J2-621" dev="ggregory" type="add" due-to="Lee Theobald, Kamal Mettananda, Gary Gregory">
- Pattern to drop first N package parts.
- </action>
- <action issue="LOG4J2-494" dev="rgoers" type="add" due-to="Philipp Knobel">
- Support merging configurations to for a composite configuration.
- </action>
- <action issue="LOG4J2-1357" dev="mikes" type="add">
- Option to not log stack traces for logged Throwables in GelfLayout.
- </action>
- <action issue="LOG4J2-1375" dev="rpopma" type="update">
- Update SLF4J from 1.7.13 to 1.7.21.
- </action>
- <action issue="LOG4J2-1374" dev="rpopma" type="update">
- Migrate tests from Logback 1.1.3 to 1.1.7.
- </action>
- <action issue="LOG4J2-1384" dev="ggregory" type="update">
- Update Apache Commons CSV from 1.2 to 1.3.
- </action>
- <action issue="LOG4J2-1372" dev="rgoers" type="fix" due-to="Kamal Mettananda, Gary Gregory">
- XMLLayout indents, but not the first child tag (Event).
- </action>
- <action issue="LOG4J2-1363" dev="rgoers" type="fix">
- Properties Configuration did not support includeLocation attribute on Loggers.
- </action>
- <action issue="LOG4J2-1263" dev="rgoers" type="fix">
- The ConfigurationSource was not saved for BuiltConfigurations so monitor interval had no effect.
- </action>
- <action issue="LOG4J2-1369" dev="ggregory" type="fix" due-to="Alex Birch, Gary Gregory">
- "xz" compression results in plaintext, uncompressed files.
- </action>
- <action issue="LOG4J2-1365" dev="mikes" type="update">
- (Log4j-internal) Provide message text as CharSequence for some message types to optimize some layouts.
- </action>
- <action issue="LOG4J2-1368" dev="rpopma" type="fix">
- (Log4j-internal) StatusLogger dropped exceptions when logging parameterized messages.
- </action>
- <action issue="LOG4J2-1348" dev="ggregory" type="add" due-to="Greg Thomas, Gary Gregory">
- Add an AutoCloseable ThreadContext class: CloseableThreadContext.
- </action>
- <action issue="LOG4J2-1345" dev="rpopma" type="update">
- (Doc) Clarify documentation for properties that control Log4j behaviour.
- </action>
- <action issue="LOG4J2-1336" dev="ggregory" type="fix" due-to="Zbynek Vyskovsky">
- LoggerFactory in 1.2 API module is not compatible with 1.2.
- </action>
- <action issue="LOG4J2-1354" dev="ggregory" type="fix" due-to="Arkadiusz Adolph">
- No configuration reload is triggered under Windows when replacing the configuration file with one that has older last modified date.
- </action>
- <action issue="LOG4J2-1346" type="fix">
- Exception from Log4jServletContextListener prevents jetty-maven-plugin run-forked.
- </action>
- <action issue="LOG4J2-1339" dev="rpopma" type="fix">
- (Perf) AsyncLogger performance optimization: avoid calling instanceof TimestampMessage in hot path.
- </action>
- <action issue="LOG4J2-1324" dev="rpopma" type="fix">
- Improve error handling in the Async Logger background thread: the new default exception handler no longer rethrows the error.
- </action>
- <action issue="LOG4J2-1309" dev="ggregory" type="fix">
- Configuration file error does not show cause exception.
- </action>
- <action issue="LOG4J2-1299" dev="ggregory" type="add">
- Add pattern converter for thread id and priority in PatternLayout.
- </action>
- <action issue="LOG4J2-1289" dev="ggregory" type="fix">
- Change flow logging text from "entry' to "Enter" and "exit" to "Exit".
- </action>
- <action issue="LOG4J2-1284" dev="rpopma" type="fix">
- Made default MessageFactory configurable.
- </action>
- <action issue="LOG4J2-1280" dev="ggregory" type="fix">
- Deprecate org.apache.logging.log4j.util.MessageSupplier.
- </action>
- <action issue="LOG4J2-1280" dev="rpopma" type="fix">
- Logger methods taking Supplier parameters now correctly handle cases where the supplied value is a Message.
- </action>
- <action issue="LOG4J2-1268" dev="rpopma" type="fix">
- FixedDateFormat was incorrect for formats having MMM with the French locale.
- </action>
- <action issue="LOG4J2-1255" dev="rgoers" type="update">
- Add enhanced entry and exit methods.
- </action>
- <action issue="LOG4J2-124" dev="rgoers" type="add">
- Add shutdown methods to LogManager.
- </action>
- <action issue="LOG4J2-1222" dev="rgoers" type="fix">
- Creation of a LoggerContext will fail if shutdown is in progress. LogManager will default to SimpleLogger instead.
- </action>
- <action issue="LOG4J2-1221" dev="rpopma" type="add" due-to="Michael Barker">
- Added async logger Timeout wait strategy and made this the default wait strategy for async loggers.
- This prevents a rare deadlock that may occur on Solaris.
- </action>
- <action issue="LOG4J2-1080" dev="rpopma" type="add">
- Added option to discard events below a certain log level if the async logger ring buffer
- or async appender queue is full.
- </action>
- <action issue="LOG4J2-1237" dev="ggregory" type="add" due-to="Mike Calmus, Gary Gregory">
- Make PatternLayout header and footer accept a pattern.
- </action>
- <action issue="LOG4J2-1244" dev="ggregory" type="add" due-to="Anshu Garg, Remko Popma, Gary Gregory">
- Make header and footer values customizable in JSONLayout.
- </action>
- <action issue="LOG4J2-1245" dev="ggregory" type="add">
- Make CSV Layout header and footers accept patterns.
- </action>
- <action issue="LOG4J2-1192" dev="ggregory" type="add" due-to="J�rg Bretschneider, Gary Gregory">
- Dynamic Subject for SMTP Appender.
- </action>
- <action issue="LOG4J2-1277" dev="ggregory" type="add" due-to="Gary Gregory, Ludovic Hochet">
- FormattedMessage, MessageFormatMessage and StringFormattedMessage should support passing in a Locale to ensure appropriate formatting.
- </action>
- <action issue="LOG4J2-1260" dev="ggregory" type="fix" due-to="Blake Day, Gary Gregory">
- TlsSyslogFrame calculates message length incorrectly.
- </action>
- <action issue="LOG4J2-1258" dev="ggregory" type="fix" due-to="Francis Lalonde">
- Async DynamicThresholdFilter does not use the log event's context map.
- </action>
- <action issue="LOG4J2-1232" dev="ggregory" type="fix" due-to="Nikolai">
- Incorrect log rotation in last week of year.
- </action>
- <action issue="LOG4J2-1248" dev="rpopma" type="fix">
- Fixed broken nanotime in pattern layout.
- </action>
- <action issue="LOG4J2-908" dev="ggregory" type="fix" due-to="Konstantinos Liakos, Patrick Flaherty, Robin Coe, Gary Gregory">
- JSONLayout doesn't add a comma between log events.
- </action>
- <action issue="LOG4J2-1230" dev="ggregory" type="fix" due-to="Vladimir Hudec, Ralph Goers, Gary Gregory">
- Don't concatenate SYSLOG Messages.
- </action>
- <action issue="LOG4J2-1238" dev="ggregory" type="fix">
- org.apache.logging.log4j.core.net.TcpSocketManager and other classes does not report internal exceptions to the status logger.
- </action>
- <action issue="LOG4J2-1212" dev="rpopma" type="fix">
- Fix documentation to specify the correct default wait strategy used by async loggers.
- </action>
- <action issue="LOG4J2-1215" dev="ggregory" type="fix" due-to="Erik Kemperman">
- Documentation/XSD inconsistencies.
- </action>
- <action issue="LOG4J2-1276" dev="ggregory" type="fix" due-to="Ludovic Hochet">
- LoggerMessageSupplierTest and LoggerSupplierTest are Locale sensitive.
- </action>
- <action issue="LOG4J2-1380" dev="ggregory" type="update">
- Update Jackson from 2.7.3 to 2.7.4.
- </action>
- <action issue="LOG4J2-1304" dev="ggregory" type="update">
- Update Jackson from 2.7.0 to 2.7.2.
- </action>
- <action issue="LOG4J2-1253" dev="ggregory" type="update">
- Update LMAX Disruptor from 3.3.2 to 3.3.4.
- </action>
- <action issue="LOG4J2-1219" dev="ggregory" type="update">
- Update SLF4J from 1.7.12 to 1.7.13.
- </action>
- <action issue="LOG4J2-1239" dev="ggregory" type="update">
- Update Jackson from 2.6.3 to 2.6.4.
- </action>
- <action issue="LOG4J2-1249" dev="ggregory" type="update">
- Update Jackson from 2.6.4 to 2.7.0.
- </action>
- <action issue="LOG4J2-1351" dev="ggregory" type="update">
- Update Jackson from 2.7.2 to 2.7.3.
- </action>
- <action issue="LOG4J2-1240" dev="ggregory" type="update">
- Update Liquibase from 3.3.5 to 3.4.2.
- </action>
- <action issue="LOG4J2-1294" dev="ggregory" type="update">
- Update Kafka client from 0.9.0.0 to 0.9.0.1.
- </action>
- <action issue="LOG4J2-1352" dev="ggregory" type="update">
- Update javax.mail from 1.5.4 to 1.5.5.
- </action>
- <action issue="LOG4J2-1358" dev="ggregory" type="update">
- Update Apache Commons Compress from 1.10 to 1.11.
- </action>
- <action issue="LOG4J2-1388" dev="rpopma" type="update">
- Update Google java-allocation-instrumenter from 3.0 to 3.0.1.
- </action>
- <action issue="LOG4J2-1233" dev="ggregory" type="update" due-to="Bahri Gencsoy">
- Misleading Value In Properties Example.
- </action>
- <action issue="LOG4J2-1251" dev="mattsicker" type="fix" due-to="Romain Manni-Bucau">
- Fix JUL bridge issue where LogRecord.getParameters() is used when null.
- </action>
- <action issue="LOG4J2-1254" dev="rpopma" type="fix" due-to="Josh Trow">
- Fix typo in Flow Tracing documentation.
- </action>
- <action issue="LOG4J2-920" dev="mattsicker" type="fix" due-to="Ludovic Hochet">
- ClassNotFoundException for BundleContextSelector when initialising in an OSGi environment.
- </action>
- <action issue="LOG4J2-1300" dev="mattsicker" type="update">
- Remove serializability from classes that don't need it.
- </action>
- <action issue="LOG4J2-1303" dev="mattsicker" type="add">
- Add documentation links to runtime dependencies in each component intro page.
- </action>
- <action issue="LOG4J2-1275" dev="mattsicker" type="fix" due-to="Ludovic Hochet">
- Fix RollingAppenderNoUnconditionalDeleteTest repeat test runs from failing.
- </action>
- <action issue="LOG4J2-1262" dev="mattsicker" type="fix">
- Stop throwing unnecessary exception in Log4jServletContextListener.contextDestroyed().
- </action>
- <action issue="LOG4J2-1252" dev="mattsicker" type="add">
- JeroMqAppender should support layouts.
- </action>
- <action issue="LOG4J2-1227" dev="mattsicker" type="fix" due-to="Olivier Lemasle">
- NullPointerException in MapLookup.lookup if the event is null.
- </action>
- <action issue="LOG4J2-1306" dev="mattsicker" type="update">
- JeroMqAppender should use ShutdownCallbackRegistry instead of runtime hooks.
- </action>
- <action issue="LOG4J2-1217" dev="mattsicker" type="add" due-to="Thies Wellpott">
- PatternLayout option to limit length of text.
- </action>
- <action issue="LOG4J2-1308" dev="mattsicker" type="update">
- Remove need to pre-specify appender et al. identifiers in property file config format.
- </action>
- <action issue="LOG4J2-1050" dev="mattsicker" type="fix" due-to="Adam Retter">
- Add a Log4jLookup class to help write log files relative to log4j2.xml.
- </action>
- <action issue="LOG4J2-1133" dev="mattsicker" type="add">
- Add JNDI lookup documentation.
- </action>
- <action issue="LOG4J2-1310" dev="mattsicker" type="fix">
- JndiLookup mindlessly casts to String and should use String.valueOf().
- </action>
- <action issue="LOG4J2-1206" dev="mattsicker" type="update">
- org.apache.logging.log4j.core.LoggerContext#updateLoggers should call firePropertyChangeEvent.
- </action>
- <action issue="LOG4J2-248" dev="mattsicker" type="fix">
- Log4jWebInitializerImpl: Use Thread instead of Class for fallback classloader.
- </action>
- <action issue="LOG4J2-1169" dev="mattsicker" type="add" due-to="Gerald Kritzinger">
- PatternLayout: Possible variable substitution in equals substitution parameter.
- </action>
- <action issue="LOG4J2-1322" dev="mattsicker" type="update">
- Update Log4j 1.x migration guide to include information about system property lookup syntax changes.
- </action>
- <action issue="LOG4J2-1330" dev="mattsicker" type="fix">
- Fix NoClassDefFoundError in ReflectionUtil on Google App Engine.
- </action>
- </release>
- <release version="2.5" date="2015-12-06" description="GA Release 2.5">
- <action issue="LOG4J2-324" dev="rpopma" type="fix">
- Reduced memory usage of status messages in bounded queue; support zero-length queue that stores no messages.
- </action>
- <action issue="LOG4J2-1173" dev="rpopma" type="fix">
- Fixed rollover error when copying to a directory mapped to a remote Linux host.
- </action>
- <action issue="LOG4J2-435" dev="rpopma" type="add" due-to="Robert Schaft">
- Added support for custom delete actions triggered by a rollover.
- </action>
- <action issue="LOG4J2-649" dev="rgoers" type="update" due-to="Aleksey Zvolinsky">
- Add PurgePolicy and IdlePurgePolicy to RoutingAppender.
- </action>
- <action issue="LOG4J2-1202" dev="rgoers" type="update">
- Remove ConfigurationMonitor. The WatchManager is now used to check for configuration changes.
- </action>
- <action issue="LOG4J2-1195" dev="mikes" type="fix" due-to="Melvin Du">
- Make KafkaAppender support SerializedLayout.
- </action>
- <action issue="LOG4J2-89" dev="rgoers" type="add">
- Allow rollover to occur at any time. Add CronTriggeringPolicy.
- </action>
- <action issue="LOG4J2-381" dev="rgoers" type="fix" due-to="Anthony Baldocchi">
- Allow triggering policy and rollover strategy to be modified during reconfiguration.
- </action>
- <action issue="LOG4J2-1136" dev="rgoers" type="add">
- Add support for JSR 223 scripts in filters and the PatternSelector.
- </action>
- <action issue="LOG4J2-1168" dev="ggregory" type="add" due-to="Steven Swor">
- Add getters for source and destination file in file rename action.
- </action>
- <action issue="LOG4J2-1175" dev="ggregory" type="add">
- Add getters for classes in org.apache.logging.log4j.core.appender.rolling.action.
- </action>
- <action issue="LOG4J2-898" dev="rpopma" type="add">
- Added system property to allow users to control whether messages should be formatted in the background.
- </action>
- <action issue="LOG4J2-1178" dev="ggregory" type="add">
- Support use-case for JDBC's CommonDataSource.setLogWriter(PrintWriter) and java.sql.DriverManager.setLogWriter(PrintWriter).
- </action>
- <action issue="LOG4J2-1187" dev="ggregory" type="add">
- Support use case for java.sql.DriverManager.setLogStream(PrintStream).
- </action>
- <action issue="LOG4J2-1029" dev="rpopma" type="fix" due-to="Stefan Leonhartsberger">
- Performance improvement when gathering location information.
- </action>
- <action issue="LOG4J2-1172" dev="rpopma" type="fix">
- Fixed ThreadLocal leak [AsyncLogger$Info] on Tomcat when using AsyncLoggerContextSelector.
- </action>
- <action issue="LOG4J2-1176" dev="rpopma" type="fix">
- Fixed memory leak when log4j jars are in Tomcat's lib folder.
- </action>
- <action issue="LOG4J2-1180" dev="ggregory" type="fix" due-to="Mikael St�ldal">
- Logger cache does not account for message factory.
- </action>
- <action issue="LOG4J2-879" dev="rpopma" type="fix">
- Documentation: fixed minor issues with the site and manual pages.
- </action>
- <action issue="LOG4J2-999" dev="rpopma" type="fix" due-to="Joan Balaguer�">
- RollingFileAppender should also roll over when log event time is equal to rollover time, not only when later.
- </action>
- <action issue="LOG4J2-873" dev="rpopma" type="fix" due-to="Martin Dickins, LC, Luke Woodward">
- Fixed bug where omitting the <display-name> element in web.xml caused incorrect log4j initialization,
- resulting in memory leaks when the web application was stopped or reloaded.
- </action>
- <action issue="LOG4J2-323" dev="rpopma" type="fix">
- Better web app support for async loggers: Fixed a memory leak that occurred when the logging jars are placed
- in the container's classpath and the configuration file uses AsyncRoot/AsyncLogger.
- The problem was that the first web application started the Disruptor background thread [AsyncLoggerConfig-1] but did not stop it until all web apps are stopped.
- Each web application now has its own Disruptor which is stopped/started together with the web app.
- </action>
- <action issue="LOG4J2-493" dev="rpopma" type="fix">
- Better web app support for async loggers: it is now possible to place the logging jars in the container's
- classpath when making all loggers asynchronous by using AsyncLoggerContextSelector. This fixes a problem where
- logging would stop working after stopping and restarting a web application.
- </action>
- <action issue="LOG4J2-1171" dev="rpopma" type="fix">
- Use servlet context name for logger context name when available.
- </action>
- <action issue="LOG4J2-1159" dev="rpopma" type="fix">
- Fixed a ThreadLocal memory leak in Tomcat8 that mentions AsyncLoggers when Async Loggers are not used.
- </action>
- <action issue="LOG4J2-1166" dev="rpopma" type="fix">
- AbstractConfiguration executor should use a DaemonThreadFactory.
- </action>
- <action issue="LOG4J2-1165" dev="rpopma" type="fix">
- Improve Log4j initialization status messages.
- </action>
- <action issue="LOG4J2-1156" dev="rpopma" type="fix">
- Web site corrections and updates.
- </action>
- <action issue="LOG4J2-1158" dev="ggregory" type="fix" due-to="Michael Fortin, Gary Gregory">
- Log4J JUL adapter is using MessageFormat on String passed by java.util.function.Supplier<String>.
- </action>
- <action issue="LOG4J2-801" dev="mattsicker" type="fix">
- org.apache.logging.log4j.core.Logger should be serializable.
- </action>
- <action issue="LOG4J2-1157" dev="mattsicker" type="fix" due-to="Norbert Bartels">
- Fix compilation error for classes annotated with @Plugin.
- </action>
- <action issue="LOG4J2-948" dev="mattsicker" type="fix" due-to="Andrew Flower">
- Fix plugin documentation error about Converters.
- </action>
- <action issue="LOG4J2-1193" dev="ggregory" type="fix">
- Prefix all thread names Log4j creates with "Log4j2-".
- </action>
- <action issue="LOG4J2-1194" dev="ggregory" type="fix" due-to="Adam Brin">
- Documentation does not match parameters for LoggerNameLevelRewritePolicy.
- </action>
- <action issue="LOG4J2-1196" dev="mattsicker" type="fix" due-to="Ren� Zanner">
- MongoDbConnection does not close MongoClient.
- </action>
- <action issue="LOG4J2-1174" dev="ggregory" type="update">
- Update Jackson from 2.6.2 to 2.6.3.
- </action>
- <action issue="LOG4J2-1207" dev="ggregory" type="update">
- Update kafka-clients from 0.8.2.2 to 0.9.0.0.
- </action>
- </release>
- <release version="2.4.1" date="2015-10-08" description="GA Release 2.4.1">
- <action issue="LOG4J2-1129" dev="rgoers" type="add">
- Allow PatternLayout to select a pattern to use based on some selection criteria.
- </action>
- <action issue="LOG4J2-1145" dev="ggregory" type="add">
- Add %equals to PatternLayout to test and replace patterns with strings.
- </action>
- <action issue="LOG4J2-1147" dev="ggregory" type="add">
- Add %equalsIgnoreCase to PatternLayout to test and replace patterns with strings.
- </action>
- <action issue="LOG4J2-1146" dev="ggregory" type="add">
- Add %notEmpty to PatternLayout to avoid output of patterns where all variables are empty.
- </action>
- <action issue="LOG4J2-1020" dev="mikes" type="add">
- Add possibility to set shutdown timeout on AsyncAppender.
- </action>
- <action issue="LOG4J2-1153" dev="rpopma" type="fix">
- Fixed NullPointerException when only root logger is defined (and no named loggers) in configuration properties file.
- </action>
- <action issue="LOG4J2-1140" dev="rpopma" type="fix">
- Fixed bug where headers were not being written to first file with RollingFileAppender.
- </action>
- <action issue="LOG4J2-1149" dev="rpopma" type="fix">
- Fixed bug where PatternLayout predefined date pattern with time zone always renders default date format.
- </action>
- <action issue="LOG4J2-1050" dev="rpopma" type="fix">
- Fixed Log4jLookup.
- </action>
- <action issue="LOG4J2-1142" dev="rpopma" type="fix">
- Fix potential memory leak in web applications by using a straight ThreadLocal field instead of subclassing ThreadLocal.
- </action>
- <action issue="LOG4J2-1135" dev="rpopma" type="fix">
- Compression on rollover was broken: log file was renamed to .zip but not compressed.
- </action>
- <action issue="LOG4J2-1127" dev="ggregory" type="fix">
- log4j2.xml cannot be parsed on Oracle Weblogic 12c.
- </action>
- <action issue="LOG4J2-1132" dev="ggregory" type="fix">
- Do not use MongoDB driver 2.13.3 deprecated methods.
- </action>
- <action issue="LOG4J2-1144" dev="ggregory" type="fix">
- Add %markerSimpleName in pattern layout should evaluate to marker name (not toString()).
- </action>
- <action issue="LOG4J2-1126" dev="ggregory" type="fix">
- Web site corrections and updates.
- </action>
- <action issue="LOG4J2-1151" dev="rpopma" type="update">
- Performance improvement: backport Java 8 fast ISO-8859-1 String to byte[] encoder to AbstractStringLayout.
- </action>
- <action issue="LOG4J2-935" dev="rpopma" type="update">
- Performance improvement when converting Strings to byte[] arrays.
- </action>
- <action issue="LOG4J2-1040" dev="ggregory" type="update">
- Update MongoDB driver from 2.13.3 to 3.0.4.
- </action>
- <action issue="LOG4J2-1128" dev="ggregory" type="update">
- Reuse StringBuilder to improve performance for String-based layouts: CSV, GELF, HTML, RFC524, Syslog.
- </action>
- <action issue="LOG4J2-1131" dev="ggregory" type="update">
- Update mongo-java-driver from 2.13.2 to 2.13.3.
- </action>
- <action issue="LOG4J2-1138" dev="ggregory" type="update">
- Do not use Jackson deprecated methods.
- </action>
- <action issue="LOG4J2-1139" dev="ggregory" type="update">
- Update Jackson from 2.6.1 to 2.6.2.
- </action>
- <action issue="LOG4J2-1150" dev="ggregory" type="update">
- Update kafka-clients from 0.8.2.1 to 0.8.2.2.
- </action>
- </release>
- <release version="2.4" date="2015-09-20" description="GA Release 2.4">
- <action issue="LOG4J2-635" dev="rgoers" type="add">
- Add support for configuration via Properties.
- </action>
- <action issue="LOG4J2-952" dev="rgoers" type="add">
- Add ConfigurationBuilder for programmatic configuration.
- </action>
- <action issue="LOG4J2-1017" dev="ggregory" type="update">
- Update Java platform from Java 6 to 7. From this version onwards, log4j 2 requires Java 7.
- </action>
- <action issue="LOG4J2-599" dev="rpopma" type="add">
- Added support for Java 8 lambda expressions to lazily construct a log message only if
- the requested log level is enabled.
- </action>
- <action issue="LOG4J2-1118" dev="rpopma" type="add">
- Updated Logger wrapper generator tool to add Java 8 lambda support for custom log levels.
- </action>
- <action issue="LOG4J2-1107" dev="ggregory" type="add" due-to="Mikael St�ldal">
- New Appender for Apache Kafka.
- </action>
- <action issue="LOG4J2-1113" dev="ggregory" type="add" due-to="Gary Gregory">
- New publisher Appender for ZeroMQ (using JeroMQ).
- </action>
- <action issue="LOG4J2-1088" dev="ggregory" type="add" due-to="Gary Gregory">
- Add Comma Separated Value (CSV) layouts for parameter and event logging.
- </action>
- <action issue="LOG4J2-812" dev="rgoers" type="update">
- PatternLayout timestamp formatting performance improvement: replaced synchronized SimpleDateFormat with
- Apache Commons FastDateFormat. This and better caching resulted in a ~3-30X faster timestamp formatting.
- </action>
- <action issue="LOG4J2-1097" dev="rpopma" type="update">
- PatternLayout timestamp formatting performance improvement: predefined date formats (and variants using
- a period '.' millisecond separator instead of ',') are now formatted ~2-10X faster than other date formats.
- </action>
- <action issue="LOG4J2-1096" dev="rpopma" type="update">
- Improved performance of ParameterizedMessage::getFormattedMessage by ~2X.
- </action>
- <action issue="LOG4J2-1120" dev="rpopma" type="update">
- LoggerConfig performance improvements: avoid unnecessary lock acquisition, use more efficient data structure.
- </action>
- <action issue="LOG4J2-1125" dev="rpopma" type="update">
- PatternLayout performance improvement by caching and reusing a ThreadLocal StringBuilder.
- </action>
- <action issue="LOG4J2-1121" dev="rpopma" type="fix">
- Fixed potential race condition on reconfiguration. Introduced ReliabilityStrategy to facilitate
- switching between different mechanisms for preventing log events from being dropped on reconfiguration.
- </action>
- <action issue="LOG4J2-1114" dev="ggregory" type="update">
- Add thread name to status logger layout.
- </action>
- <action issue="LOG4J2-1123" dev="ggregory" type="fix">
- Core Configurator.initialize(String, ClassLoader, String) fails to work when config location is a file path.
- </action>
- <action issue="LOG4J2-1117" dev="ggregory" type="fix" due-to="Marcus Thiesen">
- OutputStreamManager in ConsoleAppender leaking managers.
- </action>
- <action issue="LOG4J2-1044" dev="rgoers" type="fix">
- Write pending events to Flume when the appender is stopped.
- </action>
- <action issue="LOG4J2-1108" dev="ggregory" type="fix" due-to="Mikael St�ldal">
- NullPointerException when passing null to java.util.logging.Logger.setLevel().
- </action>
- <action issue="LOG4J2-1110" dev="ggregory" type="fix">
- org.apache.logging.log4j.jul.CoreLogger.setLevel() checks for security permission too late.
- </action>
- <action dev="rpopma" type="remove">
- Removed experimental interface LevelLogger which got committed to master by mistake.
- </action>
- <action issue="LOG4J2-1010" dev="rgoers" type="update">
- Pass log event when interpolating logger properties.
- </action>
- <action issue="LOG4J2-1090" dev="ggregory" type="add">
- Add Core Configurator APIs to change a logger's level.
- </action>
- <action issue="LOG4J2-1105" dev="ggregory" type="add" due-to="Gary Gregory">
- Add API org.apache.logging.log4j.Level.isInRange(Level, Level).
- </action>
- <action issue="LOG4J2-1106" dev="ggregory" type="add" due-to="Gary Gregory">
- Add a LevelRangeFilter class.
- </action>
- <action issue="LOG4J2-1074" dev="rpopma" type="add">
- Added support for system nanosecond time in pattern layout.
- </action>
- <action issue="LOG4J2-1075" dev="rpopma" type="add">
- Added support for compressing to bzip2 format on file rollover.
- </action>
- <action issue="LOG4J2-1077" dev="ggregory" type="add">
- Support additional Apache Commons Compress compression formats on rollover: Deflate, Pack200, XY.
- </action>
- <action issue="LOG4J2-767" dev="ggregory" type="add" due-to="Mikael St�ldal">
- New module for Liquibase integration.
- </action>
- <action issue="LOG4J2-1023" dev="ggregory" type="add" due-to="Mikael St�ldal">
- New RewritePolicy for changing level of a log event.
- </action>
- <action issue="LOG4J2-1015" dev="ggregory" type="add" due-to="Daniel Marcotte">
- Add a way to route messages based on the %marker in Layout for RoutingAppender.
- </action>
- <action issue="LOG4J2-1050" dev="ggregory" type="add" due-to="Adam Retter">
- Add a Log4jLookup class to help write log files relative to log4j2.xml.
- </action>
- <action issue="LOG4J2-1057" dev="ggregory" type="add">
- Add API org.apache.logging.log4j.LogManager.getFormatterLogger().
- </action>
- <action issue="LOG4J2-1066" dev="ggregory" type="add" due-to="Charles Allen">
- Expose Log4jContextFactory's ShutdownCallbackRegistry.
- </action>
- <action issue="LOG4J2-1084" dev="ggregory" type="fix" due-to="Philipp Schneider">
- Misleading StatusLogger WARN event in LogManager with java.util.Map.
- </action>
- <action issue="LOG4J2-1051" dev="ggregory" type="fix" due-to="Lukasz Lenart">
- NoClassDefFoundError when starting app on Google App Engine.
- </action>
- <action issue="LOG4J2-684" dev="ggregory" type="fix" due-to="Joern Huxhorn, Mauro Molinari">
- ExtendedThrowablePatternConverter does not print suppressed exceptions.
- </action>
- <action issue="LOG4J2-1069" dev="ggregory" type="fix" due-to="Sam Braam">
- Improper handling of JSON escape chars when deserializing JSON log events.
- </action>
- <action issue="LOG4J2-1068" dev="ggregory" type="fix" due-to="Andy McMullan">
- Exceptions not logged when using TcpSocketServer + SerializedLayout.
- </action>
- <action issue="LOG4J2-1067" dev="ggregory" type="fix" due-to="Sam Braam">
- ThrowableProxy getExtendedStackTraceAsString throws NPE on deserialized nested exceptions.
- </action>
- <action issue="LOG4J2-1049" dev="rpopma" type="fix" due-to="Robert Schaft">
- AsyncAppender now resets the thread interrupted flag after catching InterruptedException.
- </action>
- <action issue="LOG4J2-1048" dev="rpopma" type="fix" due-to="Nikhil">
- FileConfigurationMonitor unnecessarily calls System.currentTimeMillis() causing high CPU usage.
- </action>
- <action issue="LOG4J2-1037" dev="ggregory" type="fix" due-to="Marc Dergacz">
- Backward compatibility issue in log4j-1.2-api NDC pop() and peek().
- </action>
- <action issue="LOG4J2-1025" dev="ggregory" type="fix" due-to="Mikael St�ldal">
- Custom java.util.logging.Level gives null Log4j Level and causes NPE.
- </action>
- <action issue="LOG4J2-1033" dev="ggregory" type="fix" due-to="Mikael St�ldal">
- SimpleLogger creates unnecessary Map objects by calling ThreadContext.getContext() instead of getImmutableContext().
- </action>
- <action issue="LOG4J2-1026" dev="ggregory" type="fix">
- HighlightConverter does not obey noConsoleNoAnsi.
- </action>
- <action issue="LOG4J2-1019" dev="ggregory" type="fix">
- ZipCompressAction leaves files open until GC when an IO error takes place.
- </action>
- <action issue="LOG4J2-1020" dev="ggregory" type="fix">
- GzCompressAction leaves files open until GC when an IO error takes place.
- </action>
- <action issue="LOG4J2-1038" dev="ggregory" type="fix" due-to="Gili">
- Incorrect documentation for layout default charset.
- </action>
- <action issue="LOG4J2-1042" dev="ggregory" type="fix" due-to="Guillaume Turri">
- Socket and Syslog appenders don't take timeout into account at startup.
- </action>
- <action issue="LOG4J2-934" dev="ggregory" type="fix" due-to="Kenneth Gendron">
- Circular suppressed Exception throws StackOverflowError.
- </action>
- <action issue="LOG4J2-1046" dev="ggregory" type="fix" due-to="Kenneth Gendron">
- Circular Exception cause throws StackOverflowError.
- </action>
- <action issue="LOG4J2-982" dev="ggregory" type="fix" due-to="Mikhail Mazurskiy">
- Use System.nanoTime() to measure time intervals.
- </action>
- <action issue="LOG4J2-1045" dev="ggregory" type="fix" due-to="G�nter Albrecht">
- Externalize log4j2.xml via URL resource.
- </action>
- <action issue="LOG4J2-1058" dev="ggregory" type="fix" due-to="Daniel Branzea">
- Log4jMarker#contains(String) does not respect org.slf4j.Marker contract.
- </action>
- <action issue="LOG4J2-1060" dev="ggregory" type="fix">
- Log4jMarker#contains(Marker) does not respect org.slf4j.Marker contract.
- </action>
- <action issue="LOG4J2-1061" dev="ggregory" type="fix">
- Log4jMarker#remove(Marker) does not respect org.slf4j.Marker contract.
- </action>
- <action issue="LOG4J2-1062" dev="ggregory" type="fix">
- Log4jMarker#add(Marker) does not respect org.slf4j.Marker contract.
- </action>
- <action issue="LOG4J2-1064" dev="ggregory" type="fix">
- org.apache.logging.slf4j.Log4jMarker does not implement org.slf4j.Marker.equals(Object) org.slf4j.Marker.hashCode().
- </action>
- <action issue="LOG4J2-889" dev="rpopma" type="fix" due-to="Maciej Kara\u015b, Kenneth Leider">
- Header in layout should not be written on application startup if appending to an existing file. Fixes LOG4J2-1030.
- </action>
- <action issue="LOG4J2-918" dev="rpopma" type="fix">
- Clarify documentation for combining async with sync loggers.
- </action>
- <action issue="LOG4J2-1078" dev="ggregory" type="fix" due-to="Mikael St�ldal">
- GelfLayout throws exception if some log event fields are null.
- </action>
- <action issue="LOG4J2-1044" dev="rgoers" type="update">
- Support batchSize in FlumeAvroManager.
- </action>
- <action issue="LOG4J2-1065" dev="ggregory" type="update">
- Define org.apache.logging.log4j.Marker.equals(Object) and org.apache.logging.log4j.Marker.hashCode().
- </action>
- <action issue="LOG4J2-1063" dev="ggregory" type="update">
- Avoid creating temporary array object in org.apache.logging.slf4j.Log4jMarker.iterator().
- </action>
- <action issue="LOG4J2-890" dev="ggregory" type="update" due-to="Hassan Kalaldeh, Robert Andersson, Remko Popma">
- log4j-web-2.1 should workaround a bug in JBOSS EAP 6.2.
- </action>
- <action issue="LOG4J2-403" dev="ggregory" type="update" due-to="Poorna Subhash P, Jeremy Lautman">
- MongoDB appender, username and password should be optional.
- </action>
- <action issue="LOG4J2-1035" dev="ggregory" type="update">
- Log4j2 tries to SystemClassLoader when running on Google AppEngine.
- </action>
- <action issue="LOG4J2-1022" dev="rgoers" type="update">
- Allow a list of keys to be specified in the MDC pattern converter.
- </action>
- <action issue="LOG4J2-959" dev="ggregory" type="update">
- Fix FindBugs DM_DEFAULT_ENCODING bug in SimpleLogger.logMessage() and simplify code.
- </action>
- <action issue="LOG4J2-1036" dev="ggregory" type="update">
- Update Apache Flume from 1.5.2 to 1.6.0.
- </action>
- <action issue="LOG4J2-1041" dev="ggregory" type="update">
- Update MongoDB driver from 2.11.2 to 2.13.2.
- </action>
- <action issue="LOG4J2-1018" dev="ggregory" type="update">
- Update database tests from H2 1.3.175 to 1.3.176.
- </action>
- <action issue="LOG4J2-1070" dev="ggregory" type="update">
- Update Java Mail from 1.5.2 to 1.5.4.
- </action>
- <action issue="LOG4J2-1079" dev="ggregory" type="update">
- Update Jackson from 2.5.3 to 2.5.4.
- </action>
- <action issue="LOG4J2-1879" dev="ggregory" type="update">
- Update Jackson from 2.5.4 to 2.6.0.
- </action>
- <action issue="LOG4J2-1092" dev="ggregory" type="update">
- Update Jackson from 2.6.0 to 2.6.1.
- </action>
- <action issue="LOG4J2-1104" dev="ggregory" type="update">
- Update Apache Commons Compress from 1.9 to 1.10.
- </action>
- </release>
- <release version="2.3" date="2015-05-09" description="GA Release 2.3">
- <action issue="LOG4J2-1009" dev="ggregory" type="fix" due-to="Mikael St�ldal">
- Incorrectly defined compressionType parameter to GelfLayout.
- </action>
- <action issue="LOG4J2-1008" dev="ggregory" type="fix" due-to="Ralph Goers, Gary Gregory">
- org.apache.logging.log4j.core.config.plugins.util.ResolverUtil.extractPath(URL) incorrectly converts '+' characters to spaces.
- </action>
- <action issue="LOG4J2-1007" dev="ggregory" type="fix" due-to="Ralph Goers, Gary Gregory">
- org.apache.logging.log4j.core.util#fileFromUri(URI uri) incorrectly converts '+' characters to spaces.
- </action>
- <action issue="LOG4J2-1003" dev="ggregory" type="fix" due-to="Dan Armbrust">
- JUL Logger.throwing is mis-mapped to ERROR when it should be TRACE.
- </action>
- <action issue="LOG4J2-965" dev="ggregory" type="fix" due-to="Khotyn Huang">
- System.out no longer works after the Console appender and JANSI are initialized.
- </action>
- <action issue="LOG4J2-998" dev="ggregory" type="update" due-to="Mariano Gonzalez">
- Make org.apache.logging.log4j.core.Logger#updateConfiguration protected.
- </action>
- <action issue="LOG4J2-995" dev="rgoers" type="update">
- Move UTF-8 constant from Charsets to Constants class. Remove Charsets class.
- </action>
- <action issue="LOG4J2-993" dev="rgoers" type="fix">
- Deadlock would occur if appender thread creates a new Logger during reconfiguration.
- </action>
- <action issue="LOG4J2-991" dev="rpopma" type="fix" due-to="Ryan Rupp">
- Async root logger config should default includeLocation to false.
- </action>
- <action issue="LOG4J2-985" dev="rpopma" type="fix" due-to="Sean Dawson">
- AbstractFilter should not implement equals() and hashCode().
- </action>
- <action issue="LOG4J2-984" dev="ggregory" type="add" due-to="Jonas H�pfner">
- PatternLayout %highlight to support noConsoleNoAnsi like %style.
- </action>
- <action issue="LOG4J2-926" dev="ggregory" type="add" due-to="David Ohana">
- Truncate from the end of text format modifier.
- </action>
- <action issue="LOG4J2-980" dev="ggregory" type="fix" due-to="Mikhail Mazurskiy">
- Numerical overflow in BurstFilter not handled correctly.
- </action>
- <action issue="LOG4J2-981" dev="ggregory" type="fix" due-to="Mikhail Mazurskiy">
- Incorrect unlock in ProviderUtil.
- </action>
- <action issue="LOG4J2-966" dev="ggregory" type="fix">
- KeyStoreConfiguration.createKeyStoreConfiguration() ignores keyManagerFactoryAlgorithm.
- </action>
- <action issue="LOG4J2-976" dev="ggregory" type="fix" due-to="Matt Quinn">
- Using monitorInterval with YAML config file format causes JSONParseException.
- </action>
- <action issue="LOG4J2-964" dev="ggregory" type="fix" due-to="Jonne Jyryl�">
- StringFormattedMessage serialization is incorrect.
- </action>
- <action issue="LOG4J2-947" dev="ggregory" type="fix" due-to="Stefan Wehner">
- A new StatusLoggerAdmin listener is added to StatusLogger every time the log is reconfigured.
- </action>
- <action issue="LOG4J2-968" dev="ggregory" type="fix" due-to="Paul D Johe">
- SyslogLayout contains extra space.
- </action>
- <action issue="LOG4J2-967" dev="ggregory" type="fix" due-to="Stefan Wehner">
- log4j2.component.properties not read for all properties.
- </action>
- <action issue="LOG4J2-971" dev="ggregory" type="fix" due-to="Paul D Johe">
- Another bad priority in Syslog messages.
- </action>
- <action issue="LOG4J2-972" dev="ggregory" type="fix">
- org.apache.logging.log4j.core.net.ssl.TlsSyslogInputStreamReader does not need to create temp Integer objects.
- </action>
- <action issue="LOG4J2-974" dev="ggregory" type="fix" due-to="Daniel Gal�n y Martins">
- Typo in EventLogger documentation.
- </action>
- <action issue="LOG4J2-988" dev="ggregory" type="update">
- Update LMAX Disruptor from 3.3.0 to 3.3.2.
- </action>
- <action issue="LOG4J2-987" dev="ggregory" type="update">
- Migrate tests from Logback 1.1.2 to 1.1.3.
- </action>
- <action issue="LOG4J2-988" dev="ggregory" type="update">
- Update tests to use ActiveMQ from 5.10 to 5.11.1.
- </action>
- <action issue="LOG4J2-1004" dev="ggregory" type="update">
- Update Jackson from 2.5.1 to 2.5.3.
- </action>
- <action issue="LOG4J2-1005" dev="ggregory" type="update">
- Update Slf4j from 1.7.7 to 1.7.12.
- </action>
- </release>
- <release version="2.2" date="2015-02-22" description="GA Release 2.2">
- <action issue="LOG4J2-938" dev="rpopma" type="fix" due-to="Mauro Molinari">
- (JMX) To avoid memory leaks when web applications are restarted, JMX notifications are sent from
- the caller thread in web applications. For non-web applications notifications are sent from a background thread
- as before.
- </action>
- <action issue="LOG4J2-957" dev="ggregory" type="fix" due-to="fatih guleryuz">
- Missing toUpperCase(Locale.ENGLISH).
- </action>
- <action issue="LOG4J2-956" dev="ggregory" type="fix" due-to="David Kellerman">
- Manual refers to Route "AppenderRef" attribute, should be "ref".
- </action>
- <action issue="LOG4J2-955" dev="rpopma" type="update">
- Documentation: clarify system properties to control status logger, improve troubleshooting FAQ entry.
- </action>
- <action issue="LOG4J2-950" dev="ggregory" type="update" due-to="Joel Edwards">
- Incorrect attribute name in PropertiesRewritePolicy example.
- </action>
- <action issue="LOG4J2-944" dev="ggregory" type="fix" due-to="Vinayaka Ramachandra">
- Log4j Flume appender is not adding millisecond to the event headers when the event is logged at 000 milliseconds.
- </action>
- <action issue="LOG4J2-941" dev="ggregory" type="add" due-to="Konstantinos Liakos">
- Allow JSON layout to create one compact log record per line.
- </action>
- <action issue="LOG4J2-933" dev="ggregory" type="add" due-to="ppiman at gmail.com">
- HTML layout should not use attribute minimalization for hr noshade.
- </action>
- <action issue="LOG4J2-895" dev="ggregory" type="add">
- Specify the SyslogAppender connect timeout value as part of the configuration.
- The SyslogAppender takes a new parameter connectTimeoutMillis.
- </action>
- <action issue="LOG4J2-899" dev="ggregory" type="add">
- Specify the SocketAppender connect timeout value as part of the configuration.
- The SyslogAppender takes a new parameter connectTimeoutMillis.
- </action>
- <action issue="LOG4J2-924" dev="ggregory" type="fix" due-to="Ryan Rupp">
- Log4j 1.2 Bridge doesn't map level ALL correctly in Category.getEffectiveLevel().
- </action>
- <action issue="LOG4J2-931" dev="ggregory" type="fix" due-to="Robert Gacki">
- ConsoleAppender is missing @PluginFactory annotation at createAppender method.
- </action>
- <action issue="LOG4J2-919" dev="ggregory" type="fix" due-to="David Johle">
- Logging system fails to initialize if XInclude API is not available.
- </action>
- <action issue="LOG4J2-914" dev="ggregory" type="fix" due-to="Kaj Bjurman">
- ThrowableProxy.getExtendedStackTraceAsString causes NullPointerException.
- </action>
- <action issue="LOG4J2-912" dev="ggregory" type="fix">
- XML configuration does not report full error message for XInclude parser configuration problems.
- </action>
- <action issue="LOG4J2-903" dev="ggregory" type="fix" due-to="Mauro Molinari">
- ClassLoaderContextSelector uses ClassLoader.toString() as a key
- </action>
- <action issue="LOG4J2-834" dev="ggregory" type="fix" due-to="Nikita Koval, Leonard Broman, Thiago Kronig">
- ThrowableProxy throws NoClassDefFoundError.
- </action>
- <action issue="LOG4J2-893" dev="ggregory" type="fix">
- NullPointerException on filter when mapping JUL to Log4j2.
- </action>
- <action issue="LOG4J2-892" dev="ggregory" type="fix">
- JUL adapter does not map Log4j'2 FATAL level to a JUL level.
- </action>
- <action issue="LOG4J2-881" dev="ggregory" type="fix" due-to="Mariano Gonzalez">
- AbstractLifecycle should not implement equals() and hashCode().
- </action>
- <action issue="LOG4J2-897" dev="ggregory" type="fix">
- Javadoc for org.apache.log4j.BasicConfigurator.configure() is incorrect.
- </action>
- <action issue="LOG4J2-891" dev="ggregory" type="fix">
- AbstractLifecycle should not implement equals() and hashCode().
- </action>
- <action issue="LOG4J2-946" dev="ggregory" type="fix" due-to="artemonster">
- [docs] Using Log4j 2 in Web Applications: Update example (Log4jWebLifeCycle is not visible).
- </action>
- <action issue="LOG4J2-901" dev="ggregory" type="update" due-to="Tihomir Me\u0161\u010di\u0107, Siegfried Greisinger">
- Update docs for SyslogAppender: "No structured id name was supplied"
- </action>
- <action issue="LOG4J2-958" dev="ggregory" type="update">
- Update from Jackson 2.5.0 to 2.5.1.
- </action>
- <action issue="LOG4J2-925" dev="ggregory" type="update">
- Update from Jackson 2.4.4 to 2.5.0.
- </action>
- <action issue="LOG4J2-910" dev="ggregory" type="update">
- Update Jackson from 2.4.3 to 2.4.4.
- </action>
- <action issue="LOG4J2-881" dev="ggregory" type="update">
- Update Jackson from 2.4.2 to 2.4.3.
- </action>
- <action issue="LOG4J2-882" dev="ggregory" type="update">
- Update maven-core from 3.1.0 to 3.2.3.
- </action>
- <action issue="LOG4J2-883" dev="ggregory" type="update">
- Update tests from org.apache.felix.framework 4.2.1 to 4.4.1.
- </action>
- <action issue="LOG4J2-884" dev="ggregory" type="update">
- Update org.eclipse.osgi from 3.6.0 to 3.7.1.
- </action>
- <action issue="LOG4J2-900" dev="ggregory" type="update">
- Update Apache Flume from 1.5.0.1 to 1.5.2.
- </action>
- </release>
- <release version="2.1" date="2014-10-19" description="GA Release 2.1">
- <action issue="LOG4J2-676" dev="rgoers" type="fix" due-to="Stefan Bodewig">
- Some typo fixes and enhancements for the site.
- </action>
- <action issue="LOG4J2-868" dev="mattsicker" type="add">
- Add ShutdownCallbackRegistry interface for customizable shutdown callback handling. This is particularly
- useful for application servers that wish to integrate with Log4j 2.
- </action>
- <action issue="LOG4J2-866" dev="rpopma" type="fix" due-to="Gerard Weatherby">
- Documentation: fixed missing closing parenthesis in code example.
- </action>
- <action issue="LOG4J2-862" dev="mattsicker" type="fix" due-to="Michael Sutherland">
- Fixed classloader issue that prevented Log4j from finding the implementation when used in a custom Ant task.
- </action>
- <action issue="LOG4J2-589" dev="rpopma" type="add">
- Supported filtering on custom log levels in configuration.
- </action>
- <action issue="LOG4J2-861" dev="rpopma" type="fix">
- Documentation: fix broken links on left navigation Extending Log4j Configuration sub-menu.
- </action>
- <action issue="LOG4J2-856" dev="rpopma" type="add">
- Documentation: add sections on the JUL Adapter, IO Streams and NoSQL Appenders to the Maven and Ivy page.
- </action>
- <action issue="LOG4J2-797" dev="rpopma" type="fix" due-to="Andreas Rytina">
- Documentation: clarified why log4j-core is a compile time dependency in Maven and Ivy page.
- </action>
- <action issue="LOG4J2-855" dev="rpopma" type="fix">
- Documentation: fix broken links on Appenders manual page.
- </action>
- <action issue="LOG4J2-807" dev="rpopma" type="fix">
- Prevent NPE when configuration with AsyncLogger/AsyncRoot is reloaded.
- </action>
- <action issue="LOG4J2-848" dev="ggregory" type="add">
- Add a Java lookup to provide nicely formatted runtime version information.
- </action>
- <action issue="LOG4J2-809" dev="mattsicker" type="add">
- Move reflection utility class to API's private utility classes.
- </action>
- <action issue="LOG4J2-845" dev="mattsicker" type="update">
- Add 2.1.0 to compatible versions in Log4j API ProviderUtil and update Log4jAPIVersion to 2.1.0 in
- core META-INF/log4j-provider.properties.
- </action>
- <action issue="LOG4J2-833" dev="rpopma" type="add">
- Documentation: added Runtime Dependencies link to left nav-bar on site.
- </action>
- <action issue="LOG4J2-816" dev="rpopma" type="add">
- Documentation: added section on XInclude to user manual Configuration page.
- </action>
- <action issue="LOG4J2-678" dev="rpopma" type="fix" due-to="Matt Sicker">
- Documentation: fixed minor issues with Log4j2 web site/documentation.
- </action>
- <action issue="LOG4J2-844" dev="rpopma" type="update">
- Update JMH to 1.1 from 0.7.2.
- </action>
- <action issue="LOG4J2-843" dev="rpopma" type="fix">
- Migrate JpaHyperSqlAppenderTest JUnit performance test to log4j-perf.
- </action>
- <action issue="LOG4J2-842" dev="rpopma" type="fix">
- Migrate JpaH2AppenderTest JUnit performance test to log4j-perf.
- </action>
- <action issue="LOG4J2-841" dev="rpopma" type="fix">
- Migrate JdbcHyperSqlAppenderTest JUnit performance test to log4j-perf.
- </action>
- <action issue="LOG4J2-840" dev="rpopma" type="fix">
- Migrate JdbcH2AppenderTest JUnit performance test to log4j-perf.
- </action>
- <action issue="LOG4J2-830" dev="rpopma" type="fix">
- Respect external interrupt signal to allow application shutdown after joining AsyncAppender thread.
- </action>
- <action issue="LOG4J2-813" dev="ggregory" type="fix" due-to="David Erichsen, Brandon Barry">
- MarkerManager Log4jMarker.hasParents() returns opposite of correct result.
- </action>
- <action issue="LOG4J2-785" dev="rpopma" type="fix">
- Documentation: fixed capitalization inconsistency in user manual example config.
- </action>
- <action issue="LOG4J2-829" dev="rpopma" type="fix">
- Fixed issue in RollingFile filePattern: backslashes are path separators, not escape characters.
- </action>
- <action issue="LOG4J2-547" dev="mattsicker" type="add">
- Add the Log4j IOStreams component.
- </action>
- <action issue="LOG4J2-431" dev="rpopma" type="add" due-to="Claude Mamo">
- Added Memory-Mapped File Appender.
- </action>
- <action issue="LOG4J2-832" dev="ggregory" type="fix" due-to="Seth Leger">
- ThrowableProxy fails if a class in logged stack trace throws java.lang.Error from initializer
- </action>
- <action issue="LOG4J2-831" dev="rpopma" type="update">
- Documentation: updated FAQ "which jars" diagrams for JUL bridge and 2.1 version.
- </action>
- <action issue="LOG4J2-827" dev="mattsicker" type="add">
- Support use of TypeConverter classes through the standard Plugin system.
- </action>
- <action issue="LOG4J2-745" dev="mattsicker" type="fix" due-to="Scott Harrington">
- Avoid ConverterKey plugin clashes by using a more predictable plugin loading infrastructure.
- Plugins have been segmented into three parts: class path, user-specified packages, and OSGi bundles.
- </action>
- <action issue="LOG4J2-798" dev="mattsicker" type="fix" due-to="Scott Harrington">
- Fixed plugin scanning redundancy causing massive slowdowns in certain environments.
- </action>
- <action issue="LOG4J2-753" dev="rpopma" type="fix">
- Reduced CachedClock thread contention.
- </action>
- <action issue="LOG4J2-819" dev="mattsicker" type="fix" due-to="Gary Gregory">
- Fixed memory leak in Tomcat 6 caused by clock background threads unintentionally
- started by Tomcat after web application stop.
- </action>
- <action issue="LOG4J2-825" dev="mattsicker" type="add">
- Add simple validation constraint annotations for the Plugin system.
- </action>
- <action issue="LOG4J2-428" dev="ggregory" type="add" due-to="Mark Paluch, Mikael St�ldal">
- Implement a GELF layout.
- </action>
- <action issue="LOG4J2-391" dev="rgoers" type="fix" due-to="Kamal Bahadur">
- FlumePersistentManager now handles LockConflictExceptions in Berkeley Db when sending a batch.
- </action>
- <action issue="LOG4J2-782" dev="mattsicker" type="fix">
- Remove invalid Oracle Maven repository.
- </action>
- <action issue="LOG4J2-780" dev="mattsicker" type="update">
- Update Spring Framework to 3.2.11.RELEASE from 3.2.8.RELEASE.
- </action>
- <action issue="LOG4J2-815" dev="mattsicker" type="update">
- Unify the two JMS appenders into a single appender. Configurations written for 2.0 will still work in 2.1+.
- </action>
- <action issue="LOG4J2-608" dev="mattsicker" type="add">
- Add java.util.logging implementation based on log4j-api. See log4j-jul documentation for more details.
- </action>
- <action issue="LOG4J2-796" dev="rpopma" type="fix">
- Fixed issue where log4j-to-slf4j did not work correctly with SLF4J Simple Logger.
- </action>
- <action issue="LOG4J2-811" dev="ggregory" type="fix" due-to="Yogesh Rao">
- SimpleLogger throws ArrayIndexOutOfBoundsException for an empty array.
- </action>
- <action issue="LOG4J2-663" dev="mattsicker" type="fix" due-to="Florian Brunner">
- Fix OSGi Import-Package problem with the JMS API.
- </action>
- <action issue="LOG4J2-793" dev="mattsicker" type="add">
- Add support for custom SLF4J Markers in log4j-slf4j-impl module.
- </action>
- <action issue="LOG4J2-783" dev="rpopma" type="fix" due-to="Minglei Lee">
- PatternLayout should use platform character encoding by default, not UTF-8.
- </action>
- <action issue="LOG4J2-771" dev="ggregory" type="add">
- Add lookup for application main arguments.
- </action>
- <action issue="LOG4J2-787" dev="ggregory" type="add">
- Add lookup for JVM arguments.
- </action>
- <action issue="LOG4J2-790" dev="ggregory" type="update">
- Update Jackson to 2.4.2 from 2.4.1 (for XML and JSON processing).
- </action>
- <action issue="LOG4J2-766" dev="ggregory" type="update" due-to="Bruno P. Kinoshita">
- Incomplete documentation for JSONLayout.
- </action>
- <action issue="LOG4J2-800" dev="ggregory" type="update">
- All life cycle implementations should be serializable.
- This is still work in progress.
- </action>
- <action issue="LOG4J2-801" dev="ggregory" type="update">
- org.apache.logging.log4j.core.Logger should be serializable.
- This is still work in progress.
- </action>
- <action issue="LOG4J2-810" dev="ggregory" type="update">
- Update javax.mail to 1.5.2 from 1.5.0.
- </action>
- <action issue="LOG4J2-822" dev="ggregory" type="update">
- Update org.eclipse.persistence.jpa to 2.5.2 from 2.5.1.
- </action>
- <action issue="LOG4J2-867" dev="ggregory" type="update">
- FlumeAppender: maxDelay not in seconds, but milliseconds.
- Add time scale to some settings, for example maxDelayMillis instead of maxDelay.
- The old names are aliased for compatibility.
- </action>
- </release>
- <release version="2.0.2" date="2014-08-16" description="Bug fixes and enhancements">
- <action issue="LOG4J2-775" dev="ggregory" type="update">
- Update Apache Flume to 1.5.0.1 from 1.5.0.
- </action>
- <action issue="LOG4J2-773" dev="rpopma" type="fix">
- Site: log4j-core component pages were still using the old logo.
- </action>
- <action issue="LOG4J2-760" dev="rpopma" type="fix">
- Documentation improvement: link to dependency tree from log4j-core component page,
- link to log4j-core component page from FAQ page.
- </action>
- <action issue="LOG4J2-679" dev="rpopma" type="fix">
- Resolved race condition that caused log file rotation to fail with error: "Unable to create directory ..."
- </action>
- <action issue="LOG4J2-726" dev="rpopma" type="fix">
- Prevent application from hanging when PatternLayout configuration has opening '{' but no closing '}'.
- </action>
- <action issue="LOG4J2-7
<TRUNCATED>
[29/50] [abbrv] logging-log4j2 git commit: Fix ExecutorServices
documentation and usage of timeout = 0
Posted by mi...@apache.org.
Fix ExecutorServices documentation and usage of timeout = 0
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/4df3a6b0
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/4df3a6b0
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/4df3a6b0
Branch: refs/heads/LOG4J2-1390
Commit: 4df3a6b051ff1c44b7fcf56cb9f1c63151564510
Parents: 1e322e4
Author: Mikael St�ldal <mi...@magine.com>
Authored: Thu Oct 6 13:17:10 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Thu Oct 6 13:17:10 2016 +0200
----------------------------------------------------------------------
.../java/org/apache/logging/log4j/core/LoggerContext.java | 8 ++++----
.../org/apache/logging/log4j/core/util/ExecutorServices.java | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/4df3a6b0/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
index 7e13963..cc9ac38 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
@@ -16,8 +16,6 @@
*/
package org.apache.logging.log4j.core;
-import static org.apache.logging.log4j.core.util.ShutdownCallbackRegistry.SHUTDOWN_HOOK_MARKER;
-
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
@@ -38,7 +36,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.ConfigurationFactory;
import org.apache.logging.log4j.core.config.ConfigurationListener;
-import org.apache.logging.log4j.core.config.ConfigurationSource; // SUPPRESS CHECKSTYLE
+import org.apache.logging.log4j.core.config.ConfigurationSource;
import org.apache.logging.log4j.core.config.DefaultConfiguration;
import org.apache.logging.log4j.core.config.NullConfiguration;
import org.apache.logging.log4j.core.config.Reconfigurable;
@@ -56,6 +54,8 @@ import org.apache.logging.log4j.spi.LoggerRegistry;
import org.apache.logging.log4j.spi.Terminable;
import org.apache.logging.log4j.util.PropertiesUtil;
+import static org.apache.logging.log4j.core.util.ShutdownCallbackRegistry.SHUTDOWN_HOOK_MARKER;
+
/**
* The LoggerContext is the anchor for the logging system. It maintains a list of all the loggers requested by
* applications and a reference to the Configuration. The Configuration will contain the configured loggers, appenders,
@@ -336,7 +336,7 @@ public class LoggerContext extends AbstractLifeCycle
final String source = "LoggerContext \'" + getName() + "\'";
shutdownEs = ExecutorServices.shutdown(executorService, timeout, timeUnit, source);
// Do not wait for daemon threads
- shutdownEsd = ExecutorServices.shutdown(executorServiceDeamons, -1, timeUnit, source);
+ shutdownEsd = ExecutorServices.shutdown(executorServiceDeamons, 0, timeUnit, source);
} finally {
configLock.unlock();
this.setStopped();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/4df3a6b0/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java
index 4214c6f..37a44f5 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java
@@ -30,13 +30,13 @@ public class ExecutorServices {
* Shuts down the given {@link ExecutorService} in an orderly fashion. Disables new tasks from submission and then
* waits for existing tasks to terminate. Eventually cancels running tasks if too much time elapses.
* <p>
- * If the timeout is < 0, then a plain shutdown takes place.
+ * If the timeout is 0, then a plain shutdown takes place.
* </p>
*
* @param executorService
* the pool to shutdown.
* @param timeout
- * the maximum time to wait
+ * the maximum time to wait, or 0 to not wait for existing tasks to terminate.
* @param timeUnit
* the time unit of the timeout argument
* @param source
[49/50] [abbrv] logging-log4j2 git commit: Fix version number in
changelog
Posted by mi...@apache.org.
Fix version number in changelog
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/6ffcd1e2
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/6ffcd1e2
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/6ffcd1e2
Branch: refs/heads/LOG4J2-1390
Commit: 6ffcd1e2c09c619460779b970c14e15ec5c73cfb
Parents: 78c6a1f
Author: Matt Sicker <bo...@gmail.com>
Authored: Sun Oct 23 17:07:57 2016 -0500
Committer: Matt Sicker <bo...@gmail.com>
Committed: Sun Oct 23 17:07:57 2016 -0500
----------------------------------------------------------------------
src/changes/changes.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6ffcd1e2/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 56bf22f..d9bb156 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -40,7 +40,7 @@
Update JeroMQ from 0.3.5 to 0.3.6.
</action>
<action issue="LOG4J2-1647" dev="mattsicker" type="update">
- Update Commons Lang from 3.4 to 4.5.
+ Update Commons Lang from 3.4 to 3.5.
</action>
<action issue="LOG4J2-1646" dev="mattsicker" type="update">
Migrate to Mockito 2.x in unit tests.
[45/50] [abbrv] logging-log4j2 git commit: Remove extra blank line.
Posted by mi...@apache.org.
Remove extra blank line.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d5e45785
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d5e45785
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d5e45785
Branch: refs/heads/LOG4J2-1390
Commit: d5e45785dbbae575a67f55db9b1d7bca96774c7e
Parents: 7114c91
Author: Gary Gregory <gg...@apache.org>
Authored: Fri Oct 21 21:13:43 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Fri Oct 21 21:13:43 2016 -0700
----------------------------------------------------------------------
pom.xml | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d5e45785/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index fd49ff7..66b3bf7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,5 +1,4 @@
<?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
[20/50] [abbrv] logging-log4j2 git commit: [maven-release-plugin]
prepare release log4j-2.7-rc2
Posted by mi...@apache.org.
[maven-release-plugin] prepare release log4j-2.7-rc2
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/29cfc80d
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/29cfc80d
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/29cfc80d
Branch: refs/heads/LOG4J2-1390
Commit: 29cfc80dcddd468c1c5d4ef2c7c4435f90792628
Parents: d7f1919
Author: rgoers <ra...@dslextreme.com>
Authored: Sun Oct 2 11:13:11 2016 -0700
Committer: rgoers <ra...@dslextreme.com>
Committed: Sun Oct 2 11:13:11 2016 -0700
----------------------------------------------------------------------
log4j-1.2-api/pom.xml | 2 +-
log4j-api-scala_2.10/pom.xml | 2 +-
log4j-api-scala_2.11/pom.xml | 2 +-
log4j-api/pom.xml | 2 +-
log4j-bom/pom.xml | 4 ++--
log4j-core/pom.xml | 2 +-
log4j-distribution/pom.xml | 2 +-
log4j-flume-ng/pom.xml | 2 +-
log4j-iostreams/pom.xml | 2 +-
log4j-jcl/pom.xml | 2 +-
log4j-jmx-gui/pom.xml | 2 +-
log4j-jul/pom.xml | 2 +-
log4j-liquibase/pom.xml | 2 +-
log4j-nosql/pom.xml | 2 +-
log4j-perf/pom.xml | 2 +-
log4j-samples/configuration/pom.xml | 2 +-
log4j-samples/flume-common/pom.xml | 2 +-
log4j-samples/flume-embedded/pom.xml | 2 +-
log4j-samples/flume-remote/pom.xml | 2 +-
log4j-samples/loggerProperties/pom.xml | 2 +-
log4j-samples/pom.xml | 2 +-
log4j-samples/scala-api/pom.xml | 2 +-
log4j-slf4j-impl/pom.xml | 2 +-
log4j-taglib/pom.xml | 2 +-
log4j-to-slf4j/pom.xml | 2 +-
log4j-web/pom.xml | 2 +-
pom.xml | 4 ++--
27 files changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-1.2-api/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-1.2-api/pom.xml b/log4j-1.2-api/pom.xml
index 98b6716..2704c5b 100644
--- a/log4j-1.2-api/pom.xml
+++ b/log4j-1.2-api/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-1.2-api</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-api-scala_2.10/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-api-scala_2.10/pom.xml b/log4j-api-scala_2.10/pom.xml
index 46edf74..c11b66b 100644
--- a/log4j-api-scala_2.10/pom.xml
+++ b/log4j-api-scala_2.10/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-api-scala_2.10</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-api-scala_2.11/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-api-scala_2.11/pom.xml b/log4j-api-scala_2.11/pom.xml
index 4a7ba19..f8b5288 100644
--- a/log4j-api-scala_2.11/pom.xml
+++ b/log4j-api-scala_2.11/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-api-scala_2.11</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-api/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-api/pom.xml b/log4j-api/pom.xml
index debeb2f..9f0b641 100644
--- a/log4j-api/pom.xml
+++ b/log4j-api/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-api</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-bom/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-bom/pom.xml b/log4j-bom/pom.xml
index 34745c4..f3f8540 100644
--- a/log4j-bom/pom.xml
+++ b/log4j-bom/pom.xml
@@ -26,7 +26,7 @@
<description>Apache Log4j Bill of Materials</description>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-bom</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
@@ -143,6 +143,6 @@
</build>
<scm>
- <tag>log4j-2.6.1</tag>
+ <tag>log4j-2.7-rc2</tag>
</scm>
</project>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-core/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml
index 2fbc78c..4774f50 100644
--- a/log4j-core/pom.xml
+++ b/log4j-core/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-core</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-distribution/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-distribution/pom.xml b/log4j-distribution/pom.xml
index 6544b74..2a3ca59 100644
--- a/log4j-distribution/pom.xml
+++ b/log4j-distribution/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-distribution</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-flume-ng/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-flume-ng/pom.xml b/log4j-flume-ng/pom.xml
index 06bb7b5..89324d8 100644
--- a/log4j-flume-ng/pom.xml
+++ b/log4j-flume-ng/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-flume-ng</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-iostreams/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-iostreams/pom.xml b/log4j-iostreams/pom.xml
index c818aae..5fdac1f 100644
--- a/log4j-iostreams/pom.xml
+++ b/log4j-iostreams/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-iostreams</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-jcl/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-jcl/pom.xml b/log4j-jcl/pom.xml
index 0b6bd72..e6ac09c 100644
--- a/log4j-jcl/pom.xml
+++ b/log4j-jcl/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-jcl</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-jmx-gui/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-jmx-gui/pom.xml b/log4j-jmx-gui/pom.xml
index 97b743a..eda3674 100644
--- a/log4j-jmx-gui/pom.xml
+++ b/log4j-jmx-gui/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-jmx-gui</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-jul/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-jul/pom.xml b/log4j-jul/pom.xml
index ca161cd..13bcf91 100644
--- a/log4j-jul/pom.xml
+++ b/log4j-jul/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-liquibase/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-liquibase/pom.xml b/log4j-liquibase/pom.xml
index 7d2d66c..7242ce2 100644
--- a/log4j-liquibase/pom.xml
+++ b/log4j-liquibase/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-liquibase</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-nosql/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-nosql/pom.xml b/log4j-nosql/pom.xml
index ccf44e9..b19ce43 100644
--- a/log4j-nosql/pom.xml
+++ b/log4j-nosql/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-perf/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-perf/pom.xml b/log4j-perf/pom.xml
index a027651..8a2af25 100644
--- a/log4j-perf/pom.xml
+++ b/log4j-perf/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-samples/configuration/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-samples/configuration/pom.xml b/log4j-samples/configuration/pom.xml
index 153a394..2501f36 100644
--- a/log4j-samples/configuration/pom.xml
+++ b/log4j-samples/configuration/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j-samples</artifactId>
<groupId>org.apache.logging.log4j.samples</groupId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
</parent>
<artifactId>log4j-samples-configuration</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-samples/flume-common/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-samples/flume-common/pom.xml b/log4j-samples/flume-common/pom.xml
index 73e7975..9f3b2a8 100644
--- a/log4j-samples/flume-common/pom.xml
+++ b/log4j-samples/flume-common/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j-samples</artifactId>
<groupId>org.apache.logging.log4j.samples</groupId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
</parent>
<artifactId>log4j-samples-flume-common</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-samples/flume-embedded/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-samples/flume-embedded/pom.xml b/log4j-samples/flume-embedded/pom.xml
index 368424d..350c4d9 100644
--- a/log4j-samples/flume-embedded/pom.xml
+++ b/log4j-samples/flume-embedded/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j-samples</artifactId>
<groupId>org.apache.logging.log4j.samples</groupId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
</parent>
<artifactId>log4j-samples-flume-embedded</artifactId>
<packaging>war</packaging>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-samples/flume-remote/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-samples/flume-remote/pom.xml b/log4j-samples/flume-remote/pom.xml
index 4c487f5..7e6dad3 100644
--- a/log4j-samples/flume-remote/pom.xml
+++ b/log4j-samples/flume-remote/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j-samples</artifactId>
<groupId>org.apache.logging.log4j.samples</groupId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
</parent>
<artifactId>log4j-samples-flume-remote</artifactId>
<packaging>war</packaging>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-samples/loggerProperties/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-samples/loggerProperties/pom.xml b/log4j-samples/loggerProperties/pom.xml
index 5a4e14c..0547075 100644
--- a/log4j-samples/loggerProperties/pom.xml
+++ b/log4j-samples/loggerProperties/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j-samples</artifactId>
<groupId>org.apache.logging.log4j.samples</groupId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
</parent>
<artifactId>log4j-samples-loggerProperties</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-samples/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-samples/pom.xml b/log4j-samples/pom.xml
index 654c93e..f4876fc 100644
--- a/log4j-samples/pom.xml
+++ b/log4j-samples/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<groupId>org.apache.logging.log4j.samples</groupId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-samples/scala-api/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-samples/scala-api/pom.xml b/log4j-samples/scala-api/pom.xml
index d2d3203..30e6051 100644
--- a/log4j-samples/scala-api/pom.xml
+++ b/log4j-samples/scala-api/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j-samples</artifactId>
<groupId>org.apache.logging.log4j.samples</groupId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
</parent>
<artifactId>log4j-samples-scala-api</artifactId>
<packaging>jar</packaging>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-slf4j-impl/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-slf4j-impl/pom.xml b/log4j-slf4j-impl/pom.xml
index a788d67..d962dd5 100644
--- a/log4j-slf4j-impl/pom.xml
+++ b/log4j-slf4j-impl/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-slf4j-impl</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-taglib/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-taglib/pom.xml b/log4j-taglib/pom.xml
index 55f76a3..fb5fdcd 100644
--- a/log4j-taglib/pom.xml
+++ b/log4j-taglib/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-taglib</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-to-slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-to-slf4j/pom.xml b/log4j-to-slf4j/pom.xml
index e95de69..eb45f64 100644
--- a/log4j-to-slf4j/pom.xml
+++ b/log4j-to-slf4j/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-to-slf4j</artifactId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/log4j-web/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-web/pom.xml b/log4j-web/pom.xml
index 22dd052..2dc469a 100644
--- a/log4j-web/pom.xml
+++ b/log4j-web/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>log4j</artifactId>
<groupId>org.apache.logging.log4j</groupId>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/29cfc80d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a32f984..e9b8da6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
<artifactId>log4j</artifactId>
<packaging>pom</packaging>
<name>Apache Log4j 2</name>
- <version>2.7.1-SNAPSHOT</version>
+ <version>2.7</version>
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
@@ -173,7 +173,7 @@
<connection>scm:git:http://git-wip-us.apache.org/repos/asf/logging-log4j2.git</connection>
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/logging-log4j2.git</developerConnection>
<url>https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;a=summary</url>
- <tag>log4j-${Log4jReleaseVersion}</tag>
+ <tag>log4j-2.7-rc2</tag>
</scm>
<organization>
<name>Apache Software Foundation</name>
[04/50] [abbrv] logging-log4j2 git commit: [LOG4J2-1619] new
Log4jLogEvent().toString() throws an NPE.
Posted by mi...@apache.org.
[LOG4J2-1619] new Log4jLogEvent().toString() throws an NPE.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/83cd00eb
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/83cd00eb
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/83cd00eb
Branch: refs/heads/LOG4J2-1390
Commit: 83cd00eb611b9715c3a95961ad44b3ce4c69b5a4
Parents: e6781f5
Author: Gary Gregory <gg...@apache.org>
Authored: Wed Sep 28 16:14:15 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Sep 28 16:14:15 2016 -0700
----------------------------------------------------------------------
.../org/apache/logging/log4j/core/impl/Log4jLogEventTest.java | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/83cd00eb/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventTest.java
index 0199444..9f079ce 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/impl/Log4jLogEventTest.java
@@ -521,4 +521,10 @@ public class Log4jLogEventTest {
assertNotEquals(reason, other, event);
assertNotEquals(reason + " hashCode", other.hashCode(), event.hashCode());
}
+
+ @Test
+ public void testToString() {
+ // Throws an NPE in 2.6.2
+ assertNotNull(new Log4jLogEvent().toString());
+ }
}
[50/50] [abbrv] logging-log4j2 git commit: Merge branch 'master' into
LOG4J2-1390
Posted by mi...@apache.org.
Merge branch 'master' into LOG4J2-1390
# Conflicts:
# log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/39e28336
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/39e28336
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/39e28336
Branch: refs/heads/LOG4J2-1390
Commit: 39e2833698ddea21e10cb9a57e1638f40cdda0a1
Parents: 3fac1c7 6ffcd1e
Author: Mikael St�ldal <mi...@magine.com>
Authored: Mon Oct 24 10:07:38 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Mon Oct 24 10:07:38 2016 +0200
----------------------------------------------------------------------
.gitignore | 14 +-
BUILDING.txt | 100 +-
README.md | 8 +
RELEASE-NOTES.txt | 200 ++--
log4j-1.2-api/.gitignore | 5 -
log4j-1.2-api/pom.xml | 9 +-
.../src/main/java/org/apache/log4j/Layout.java | 4 +-
.../apache/log4j/config/InputStreamWrapper.java | 92 ++
.../config/Log4j1ConfigurationConverter.java | 211 ++++
.../config/Log4j1ConfigurationFactory.java | 278 +----
.../log4j/config/Log4j1ConfigurationParser.java | 446 ++++++++
.../apache/log4j/layout/Log4j1XmlLayout.java | 162 +++
.../pattern/Log4j1MdcPatternConverter.java | 88 ++
.../pattern/Log4j1NdcPatternConverter.java | 63 ++
.../apache/log4j/BasicConfigurationFactory.java | 13 +-
.../java/org/apache/log4j/CategoryTest.java | 3 +-
.../java/org/apache/log4j/LogWithMDCTest.java | 6 +-
.../java/org/apache/log4j/LogWithRouteTest.java | 6 +-
...bstractLog4j1ConfigurationConverterTest.java | 69 ++
.../Log4j1ConfigurationConverterHadoopTest.java | 39 +
.../Log4j1ConfigurationConverterSparkTest.java | 39 +
.../config/Log4j1ConfigurationFactoryTest.java | 237 +++-
.../log4j/layout/Log4j1XmlLayoutTest.java | 84 ++
.../pattern/Log4j1MdcPatternConverterTest.java | 79 ++
.../pattern/Log4j1NdcPatternConverterTest.java | 74 ++
.../src/main/resources/log4j.properties | 19 +
.../src/main/conf/log4j.properties | 323 ++++++
.../src/test/resources/log4j.properties | 18 +
.../src/test/resources/log4j.properties | 31 +
.../src/main/resources/log4j.properties | 31 +
.../src/test/resources/log4j.properties | 18 +
.../src/test/resources/log4j.properties | 49 +
.../src/test/resources/log4j.properties | 55 +
.../src/test/resources/log4j.properties | 49 +
.../src/test/resources/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 23 +
.../src/test/resources/log4j.properties | 25 +
.../src/test/resources/log4j.properties | 42 +
.../src/main/sample-conf/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 37 +
.../src/test/resources/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 63 ++
.../src/test/resources/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 19 +
.../src/test/resources/log4j.properties | 19 +
.../log4j-DailyRollingFileAppender.properties | 26 +
.../config-1.2/log4j-NullAppender.properties | 9 +
...4j-RollingFileAppender-with-props.properties | 27 +
.../log4j-RollingFileAppender.properties | 22 +
...g4j-console-EnhancedPatternLayout.properties | 3 +-
.../log4j-console-HtmlLayout.properties | 3 +-
.../log4j-console-PatternLayout.properties | 1 -
.../log4j-console-SimpleLayout.properties | 1 -
.../log4j-console-TTCCLayout.properties | 3 +-
.../log4j-console-XmlLayout.properties | 5 +-
.../log4j-file-SimpleLayout.properties | 17 +
.../log4j-system-properties-1.properties | 14 +
.../log4j-system-properties-2.properties | 15 +
.../config-1.2/spark/R/log4j.properties | 28 +
.../src/test/resources/log4j.properties | 27 +
.../src/test/resources/log4j.properties | 24 +
.../core/src/test/resources/log4j.properties | 36 +
.../src/test/resources/log4j.properties | 28 +
.../flume/src/test/resources/log4j.properties | 28 +
.../src/test/resources/log4j.properties | 27 +
.../src/test/resources/log4j.properties | 28 +
.../src/test/resources/log4j.properties | 28 +
.../src/main/resources/log4j.properties | 37 +
.../src/test/resources/log4j.properties | 27 +
.../graphx/src/test/resources/log4j.properties | 27 +
.../src/test/resources/log4j.properties | 33 +
.../mllib/src/test/resources/log4j.properties | 28 +
.../repl/src/test/resources/log4j.properties | 27 +
.../src/test/resources/log4j.properties | 27 +
.../core/src/test/resources/log4j.properties | 57 +
.../hive/src/test/resources/log4j.properties | 61 ++
.../src/test/resources/log4j.properties | 28 +
.../yarn/src/test/resources/log4j.properties | 31 +
log4j-api-scala_2.10/pom.xml | 150 +++
.../org/apache/logging/log4j/scala/Logger.scala | 592 ++++++++++
.../logging/log4j/scala/LoggerMacro.scala | 425 ++++++++
.../apache/logging/log4j/scala/Logging.scala | 30 +
.../apache/logging/log4j/scala/LoggerTest.scala | 550 ++++++++++
log4j-api-scala_2.11/pom.xml | 150 +++
.../org/apache/logging/log4j/scala/Logger.scala | 592 ++++++++++
.../logging/log4j/scala/LoggerMacro.scala | 425 ++++++++
.../apache/logging/log4j/scala/Logging.scala | 30 +
.../apache/logging/log4j/scala/LoggerTest.scala | 550 ++++++++++
log4j-api/.gitignore | 5 -
log4j-api/pom.xml | 2 +-
.../logging/log4j/CloseableThreadContext.java | 11 +-
.../org/apache/logging/log4j/LogManager.java | 18 +-
.../java/org/apache/logging/log4j/Logger.java | 70 +-
.../org/apache/logging/log4j/MarkerManager.java | 4 +-
.../org/apache/logging/log4j/ThreadContext.java | 123 ++-
.../log4j/message/AbstractMessageFactory.java | 110 +-
.../message/DefaultFlowMessageFactory.java | 15 +-
.../log4j/message/FormattedMessageFactory.java | 97 +-
.../logging/log4j/message/LocalizedMessage.java | 2 +-
.../log4j/message/LocalizedMessageFactory.java | 10 +-
.../logging/log4j/message/MessageFactory2.java | 112 +-
.../log4j/message/MessageFormatMessage.java | 2 +-
.../message/MessageFormatMessageFactory.java | 93 +-
.../logging/log4j/message/ObjectMessage.java | 21 +-
.../log4j/message/ParameterFormatter.java | 36 +-
.../log4j/message/ParameterizedMessage.java | 22 +-
.../message/ParameterizedMessageFactory.java | 105 +-
.../ParameterizedNoReferenceMessageFactory.java | 12 +-
.../log4j/message/ReusableMessageFactory.java | 21 +-
.../log4j/message/ReusableObjectMessage.java | 26 +-
.../message/ReusableParameterizedMessage.java | 92 +-
.../log4j/message/ReusableSimpleMessage.java | 4 +-
.../logging/log4j/message/SimpleMessage.java | 4 +-
.../log4j/message/SimpleMessageFactory.java | 102 +-
.../log4j/message/StringFormattedMessage.java | 6 +
.../message/StringFormatterMessageFactory.java | 94 +-
.../log4j/simple/SimpleLoggerContext.java | 14 +-
.../simple/SimpleLoggerContextFactory.java | 1 +
.../logging/log4j/spi/AbstractLogger.java | 112 +-
.../log4j/spi/AbstractLoggerAdapter.java | 31 +-
.../apache/logging/log4j/spi/CopyOnWrite.java | 25 +
.../CopyOnWriteSortedArrayThreadContextMap.java | 224 ++++
.../log4j/spi/DefaultThreadContextMap.java | 64 +-
.../GarbageFreeSortedArrayThreadContextMap.java | 225 ++++
.../logging/log4j/spi/LoggerRegistry.java | 2 +-
.../log4j/spi/MutableThreadContextStack.java | 10 +-
.../logging/log4j/spi/NoOpThreadContextMap.java | 65 ++
.../org/apache/logging/log4j/spi/Provider.java | 6 +-
.../logging/log4j/spi/ThreadContextMap.java | 63 +-
.../logging/log4j/spi/ThreadContextMap2.java | 51 +
.../log4j/spi/ThreadContextMapFactory.java | 91 ++
.../logging/log4j/spi/ThreadContextStack.java | 1 +
.../apache/logging/log4j/status/StatusData.java | 2 +-
.../logging/log4j/status/StatusLogger.java | 2 +-
.../apache/logging/log4j/util/Activator.java | 1 +
.../apache/logging/log4j/util/BiConsumer.java | 35 +
.../apache/logging/log4j/util/Constants.java | 62 ++
.../apache/logging/log4j/util/LambdaUtil.java | 2 +-
.../apache/logging/log4j/util/LoaderUtil.java | 48 +-
.../logging/log4j/util/PropertiesUtil.java | 597 +++++-----
.../logging/log4j/util/ReadOnlyStringMap.java | 106 ++
.../log4j/util/SortedArrayStringMap.java | 528 +++++++++
.../logging/log4j/util/StringBuilders.java | 38 +-
.../apache/logging/log4j/util/StringMap.java | 98 ++
.../org/apache/logging/log4j/util/Strings.java | 70 ++
.../org/apache/logging/log4j/util/Supplier.java | 1 +
.../apache/logging/log4j/util/TriConsumer.java | 37 +
.../org/apache/logging/log4j/util/Unbox.java | 137 ++-
.../logging/log4j/AbstractLoggerTest.java | 4 +-
.../log4j/CloseableThreadContextTest.java | 11 +-
.../apache/logging/log4j/LogManagerTest.java | 2 +-
.../org/apache/logging/log4j/LoggerTest.java | 78 +-
.../apache/logging/log4j/TestLoggerContext.java | 4 +-
.../logging/log4j/ThreadContextHolder.java | 79 ++
.../apache/logging/log4j/ThreadContextTest.java | 20 +
.../apache/logging/log4j/TraceLoggingTest.java | 316 ++++++
.../logging/log4j/junit/BundleTestInfo.java | 137 +--
.../apache/logging/log4j/junit/OsgiRule.java | 141 +--
.../log4j/junit/ThreadContextMapRule.java | 37 +
.../logging/log4j/junit/ThreadContextRule.java | 78 ++
.../log4j/junit/ThreadContextStackRule.java | 37 +
.../logging/log4j/message/JsonMessage.java | 2 +-
.../log4j/message/ParameterFormatterTest.java | 12 +-
.../log4j/message/ParameterizedMessageTest.java | 24 +
.../message/ReusableMessageFactoryTest.java | 130 +++
.../message/ReusableObjectMessageTest.java | 18 +-
.../ReusableParameterizedMessageTest.java | 21 +-
.../message/ReusableSimpleMessageTest.java | 18 +-
.../log4j/spi/DefaultThreadContextMapTest.java | 26 +-
.../logging/log4j/spi/LoggerAdapterTest.java | 126 +++
.../log4j/util/SortedArrayStringMapTest.java | 1029 ++++++++++++++++++
.../apache/logging/log4j/util/Unbox1Test.java | 170 +++
.../log4j/util/Unbox2ConfigurableTest.java | 91 ++
.../apache/logging/log4j/util/UnboxTest.java | 157 ---
log4j-bom/.gitignore | 2 -
log4j-bom/pom.xml | 26 +-
log4j-core/.gitignore | 5 -
log4j-core/pom.xml | 56 +-
.../logging/log4j/ThreadContextAccess.java | 59 +
.../logging/log4j/core/AbstractLifeCycle.java | 25 +-
.../logging/log4j/core/AbstractLogEvent.java | 6 +
.../logging/log4j/core/ContextDataInjector.java | 108 ++
.../apache/logging/log4j/core/LifeCycle.java | 11 +-
.../apache/logging/log4j/core/LifeCycle2.java | 37 +
.../org/apache/logging/log4j/core/LogEvent.java | 25 +
.../org/apache/logging/log4j/core/Logger.java | 4 +-
.../logging/log4j/core/LoggerContext.java | 161 ++-
.../log4j/core/appender/AbstractAppender.java | 65 ++
.../log4j/core/appender/AbstractManager.java | 90 +-
.../appender/AbstractOutputStreamAppender.java | 62 +-
.../core/appender/AbstractWriterAppender.java | 248 ++---
.../log4j/core/appender/AppenderSet.java | 137 +++
.../log4j/core/appender/AsyncAppender.java | 174 ++-
.../core/appender/ConfigurationFactoryData.java | 50 +
.../log4j/core/appender/ConsoleAppender.java | 153 +--
.../core/appender/CountingNoOpAppender.java | 9 +-
.../log4j/core/appender/FailoverAppender.java | 2 +-
.../log4j/core/appender/FileAppender.java | 279 +++--
.../log4j/core/appender/FileManager.java | 114 +-
.../core/appender/MemoryMappedFileAppender.java | 13 +-
.../core/appender/MemoryMappedFileManager.java | 14 +-
.../log4j/core/appender/NullAppender.java | 48 +
.../core/appender/OutputStreamAppender.java | 3 +-
.../core/appender/OutputStreamManager.java | 635 ++++++-----
.../core/appender/RandomAccessFileAppender.java | 25 +-
.../core/appender/RandomAccessFileManager.java | 35 +-
.../core/appender/RollingFileAppender.java | 578 ++++++----
.../RollingRandomAccessFileAppender.java | 15 +-
.../core/appender/ScriptAppenderSelector.java | 141 +++
.../log4j/core/appender/SmtpAppender.java | 3 +-
.../log4j/core/appender/SocketAppender.java | 244 ++++-
.../log4j/core/appender/SyslogAppender.java | 11 +-
.../log4j/core/appender/WriterAppender.java | 3 +-
.../log4j/core/appender/WriterManager.java | 300 ++---
.../appender/db/AbstractDatabaseAppender.java | 280 ++---
.../appender/db/AbstractDatabaseManager.java | 457 ++++----
.../db/jdbc/FactoryMethodConnectionSource.java | 4 +-
.../core/appender/db/jdbc/JdbcAppender.java | 3 +-
.../appender/db/jdbc/JdbcDatabaseManager.java | 515 ++++-----
.../db/jpa/AbstractLogEventWrapperEntity.java | 31 +-
.../appender/db/jpa/BasicLogEventEntity.java | 1 -
.../log4j/core/appender/db/jpa/JpaAppender.java | 7 +-
.../appender/db/jpa/JpaDatabaseManager.java | 381 +++----
.../ContextDataAttributeConverter.java | 46 +
.../ContextDataJsonAttributeConverter.java | 93 ++
.../converter/ThrowableAttributeConverter.java | 4 +-
.../log4j/core/appender/mom/JmsAppender.java | 425 ++++----
.../log4j/core/appender/mom/JmsManager.java | 347 +++---
.../appender/mom/jeromq/JeroMqAppender.java | 10 +-
.../core/appender/mom/jeromq/JeroMqManager.java | 442 ++++----
.../core/appender/mom/kafka/KafkaAppender.java | 23 +-
.../core/appender/mom/kafka/KafkaManager.java | 18 +-
.../core/appender/rewrite/RewriteAppender.java | 7 +-
.../rolling/AbstractTriggeringPolicy.java | 28 +
.../rolling/CompositeTriggeringPolicy.java | 187 ++--
.../appender/rolling/CronTriggeringPolicy.java | 74 +-
.../rolling/DefaultRolloverStrategy.java | 40 +-
.../log4j/core/appender/rolling/FileSize.java | 181 +--
.../rolling/OnStartupTriggeringPolicy.java | 58 +-
.../core/appender/rolling/PatternProcessor.java | 12 +-
.../appender/rolling/RollingFileManager.java | 113 +-
.../rolling/RollingRandomAccessFileManager.java | 46 +-
.../rolling/SizeBasedTriggeringPolicy.java | 206 ++--
.../rolling/TimeBasedTriggeringPolicy.java | 2 +-
.../core/appender/rolling/TriggeringPolicy.java | 10 +-
.../rolling/action/CommonsCompressAction.java | 9 +-
.../appender/rolling/action/DeleteAction.java | 2 +-
.../core/appender/rolling/action/Duration.java | 514 ++++-----
.../rolling/action/FileRenameAction.java | 97 +-
.../core/appender/rolling/action/IfAll.java | 232 ++--
.../core/appender/rolling/action/IfAny.java | 172 +--
.../core/appender/routing/IdlePurgePolicy.java | 82 +-
.../core/appender/routing/PurgePolicy.java | 6 +-
.../log4j/core/appender/routing/Routes.java | 176 ++-
.../core/appender/routing/RoutingAppender.java | 250 ++++-
.../core/async/ArrayBlockingQueueFactory.java | 42 +
.../logging/log4j/core/async/AsyncLogger.java | 53 +-
.../log4j/core/async/AsyncLoggerConfig.java | 8 +-
...syncLoggerConfigDefaultExceptionHandler.java | 4 +-
.../core/async/AsyncLoggerConfigDisruptor.java | 26 +-
.../log4j/core/async/AsyncLoggerContext.java | 14 +-
.../AsyncLoggerDefaultExceptionHandler.java | 4 +-
.../log4j/core/async/AsyncLoggerDisruptor.java | 487 +++++----
.../log4j/core/async/BlockingQueueFactory.java | 42 +
.../log4j/core/async/DaemonThreadFactory.java | 53 -
.../core/async/DefaultAsyncQueueFullPolicy.java | 14 +-
.../async/DisruptorBlockingQueueFactory.java | 53 +
.../logging/log4j/core/async/DisruptorUtil.java | 2 +-
.../core/async/JCToolsBlockingQueueFactory.java | 198 ++++
.../core/async/LinkedTransferQueueFactory.java | 43 +
.../log4j/core/async/RingBufferLogEvent.java | 84 +-
.../async/RingBufferLogEventTranslator.java | 20 +-
.../core/config/AbstractConfiguration.java | 94 +-
.../log4j/core/config/AppenderControl.java | 5 +-
.../log4j/core/config/AppendersPlugin.java | 4 +-
.../AwaitCompletionReliabilityStrategy.java | 350 +++---
...AwaitUnconditionallyReliabilityStrategy.java | 246 ++---
.../log4j/core/config/Configuration.java | 22 +-
.../core/config/ConfigurationException.java | 14 +-
.../log4j/core/config/ConfigurationFactory.java | 107 +-
.../core/config/ConfigurationScheduler.java | 78 +-
.../log4j/core/config/ConfigurationSource.java | 6 +-
.../core/config/ConfiguratonFileWatcher.java | 32 +-
.../logging/log4j/core/config/Configurator.java | 722 ++++++------
.../log4j/core/config/CronScheduledFuture.java | 43 +-
.../log4j/core/config/DefaultConfiguration.java | 2 +-
.../core/config/DefaultReliabilityStrategy.java | 214 ++--
.../core/config/LockingReliabilityStrategy.java | 270 ++---
.../logging/log4j/core/config/LoggerConfig.java | 129 ++-
.../log4j/core/config/NullConfiguration.java | 2 +-
.../logging/log4j/core/config/Property.java | 16 +-
.../core/config/ReliabilityStrategyFactory.java | 140 +--
.../core/config/builder/api/Component.java | 4 +-
.../builder/api/ConfigurationBuilder.java | 53 +-
.../config/builder/impl/BuiltConfiguration.java | 16 +-
.../builder/impl/DefaultComponentBuilder.java | 4 +-
.../impl/DefaultConfigurationBuilder.java | 218 +++-
.../DefaultCustomLevelComponentBuilder.java | 2 +-
.../impl/DefaultLoggerComponentBuilder.java | 4 +-
.../impl/DefaultScriptFileComponentBuilder.java | 8 +-
.../composite/CompositeConfiguration.java | 58 +-
.../config/composite/DefaultMergeStrategy.java | 92 +-
.../core/config/json/JsonConfiguration.java | 13 +-
.../config/json/JsonConfigurationFactory.java | 5 +-
.../config/plugins/PluginBuilderFactory.java | 1 +
.../config/plugins/PluginConfiguration.java | 1 +
.../core/config/plugins/PluginFactory.java | 2 +-
.../log4j/core/config/plugins/PluginNode.java | 1 +
.../config/plugins/convert/TypeConverters.java | 4 +-
.../core/config/plugins/util/PluginBuilder.java | 6 +-
.../config/plugins/util/PluginRegistry.java | 1 -
.../core/config/plugins/util/ResolverUtil.java | 13 +-
.../plugins/visitors/PluginElementVisitor.java | 3 +
.../plugins/visitors/PluginValueVisitor.java | 18 +-
.../properties/PropertiesConfiguration.java | 8 +-
.../PropertiesConfigurationBuilder.java | 89 +-
.../PropertiesConfigurationFactory.java | 15 +-
.../log4j/core/config/xml/XmlConfiguration.java | 56 +-
.../config/xml/XmlConfigurationFactory.java | 6 +-
.../core/config/yaml/YamlConfiguration.java | 7 +-
.../config/yaml/YamlConfigurationFactory.java | 5 +-
.../log4j/core/filter/AbstractFilter.java | 23 +-
.../log4j/core/filter/AbstractFilterable.java | 73 +-
.../logging/log4j/core/filter/BurstFilter.java | 2 +-
.../log4j/core/filter/CompositeFilter.java | 33 +-
.../core/filter/DynamicThresholdFilter.java | 107 +-
.../log4j/core/filter/LevelRangeFilter.java | 17 +-
.../logging/log4j/core/filter/MapFilter.java | 17 +-
.../logging/log4j/core/filter/ScriptFilter.java | 16 +-
.../core/filter/ThreadContextMapFilter.java | 25 +-
.../log4j/core/filter/ThresholdFilter.java | 16 +-
.../logging/log4j/core/filter/TimeFilter.java | 2 +-
.../log4j/core/impl/ContextDataFactory.java | 95 ++
.../core/impl/ContextDataInjectorFactory.java | 92 ++
.../log4j/core/impl/DefaultLogEventFactory.java | 7 +-
.../log4j/core/impl/ExtendedClassInfo.java | 23 +-
.../core/impl/ExtendedStackTraceElement.java | 46 +-
.../log4j/core/impl/JdkMapAdapterStringMap.java | 201 ++++
.../log4j/core/impl/Log4jContextFactory.java | 14 +-
.../logging/log4j/core/impl/Log4jLogEvent.java | 150 ++-
.../log4j/core/impl/MutableLogEvent.java | 67 +-
.../core/impl/ReusableLogEventFactory.java | 28 +-
.../core/impl/ThreadContextDataInjector.java | 202 ++++
.../log4j/core/impl/ThrowableFormatOptions.java | 126 ++-
.../logging/log4j/core/impl/ThrowableProxy.java | 407 +++----
.../ContextDataAsEntryListDeserializer.java | 57 +
.../ContextDataAsEntryListSerializer.java | 58 +
.../core/jackson/ContextDataDeserializer.java | 65 ++
.../core/jackson/ContextDataSerializer.java | 64 ++
.../log4j/core/jackson/Initializers.java | 28 +-
.../log4j/core/jackson/Log4jJsonModule.java | 13 +-
.../core/jackson/Log4jJsonObjectMapper.java | 9 +-
.../log4j/core/jackson/Log4jXmlModule.java | 6 +-
.../core/jackson/Log4jXmlObjectMapper.java | 9 +-
.../log4j/core/jackson/Log4jYamlModule.java | 13 +-
.../core/jackson/Log4jYamlObjectMapper.java | 9 +-
.../log4j/core/jackson/LogEventJsonMixIn.java | 150 +++
.../log4j/core/jackson/LogEventMixIn.java | 138 ---
.../jackson/LogEventWithContextListMixIn.java | 148 +++
.../ThrowableProxyWithoutStacktraceMixIn.java | 77 ++
.../log4j/core/jmx/LoggerContextAdmin.java | 4 +-
.../apache/logging/log4j/core/jmx/Server.java | 31 +-
.../log4j/core/layout/AbstractCsvLayout.java | 10 +-
.../core/layout/AbstractJacksonLayout.java | 1 -
.../log4j/core/layout/AbstractStringLayout.java | 53 +-
.../log4j/core/layout/CsvLogEventLayout.java | 38 +-
.../log4j/core/layout/CsvParameterLayout.java | 7 +-
.../logging/log4j/core/layout/GelfLayout.java | 66 +-
.../logging/log4j/core/layout/HtmlLayout.java | 123 ++-
.../log4j/core/layout/JacksonFactory.java | 32 +-
.../logging/log4j/core/layout/JsonLayout.java | 30 +-
.../core/layout/MarkerPatternSelector.java | 23 +-
.../log4j/core/layout/PatternLayout.java | 37 +-
.../core/layout/ScriptPatternSelector.java | 25 +-
.../log4j/core/layout/TextEncoderHelper.java | 4 +-
.../logging/log4j/core/layout/XmlLayout.java | 17 +-
.../logging/log4j/core/layout/YamlLayout.java | 15 +-
.../log4j/core/lookup/ContextMapLookup.java | 17 +-
.../logging/log4j/core/lookup/Interpolator.java | 61 +-
.../logging/log4j/core/lookup/JndiLookup.java | 5 +-
.../log4j/core/lookup/StrSubstitutor.java | 19 +
.../log4j/core/net/AbstractSocketManager.java | 6 +-
.../log4j/core/net/DatagramSocketManager.java | 21 +-
.../logging/log4j/core/net/JndiManager.java | 287 ++---
.../log4j/core/net/MulticastDnsAdvertiser.java | 6 +-
.../logging/log4j/core/net/SmtpManager.java | 8 +-
.../log4j/core/net/SslSocketManager.java | 31 +-
.../log4j/core/net/TcpSocketManager.java | 106 +-
.../core/net/server/AbstractSocketServer.java | 88 +-
.../log4j/core/net/server/JmsServer.java | 286 ++---
.../server/JsonInputStreamLogEventBridge.java | 6 +-
.../log4j/core/net/server/TcpSocketServer.java | 184 ++--
.../log4j/core/net/server/UdpSocketServer.java | 83 +-
.../net/ssl/AbstractKeyStoreConfiguration.java | 38 +
.../core/net/ssl/KeyStoreConfiguration.java | 36 +-
.../log4j/core/net/ssl/SslConfiguration.java | 77 +-
.../log4j/core/net/ssl/StoreConfiguration.java | 3 +
.../core/net/ssl/TrustStoreConfiguration.java | 33 +-
.../core/pattern/DatePatternConverter.java | 2 +-
.../pattern/EqualsReplacementConverter.java | 2 +-
.../ExtendedThrowablePatternConverter.java | 11 +-
.../log4j/core/pattern/HighlightConverter.java | 38 +-
.../log4j/core/pattern/HtmlTextRenderer.java | 38 +
.../log4j/core/pattern/JAnsiTextRenderer.java | 332 ++++++
.../pattern/LineSeparatorPatternConverter.java | 4 +-
.../log4j/core/pattern/MdcPatternConverter.java | 112 +-
.../core/pattern/MessagePatternConverter.java | 83 +-
.../log4j/core/pattern/NameAbbreviator.java | 104 +-
.../log4j/core/pattern/PlainTextRenderer.java | 40 +
.../pattern/RootThrowablePatternConverter.java | 10 +-
.../pattern/SequenceNumberPatternConverter.java | 1 -
.../log4j/core/pattern/StyleConverter.java | 24 +-
.../log4j/core/pattern/TextRenderer.java | 46 +
.../core/pattern/ThrowablePatternConverter.java | 5 +-
.../VariablesNotEmptyReplacementConverter.java | 2 +-
.../log4j/core/script/AbstractScript.java | 5 +
.../logging/log4j/core/script/Script.java | 10 +-
.../logging/log4j/core/script/ScriptFile.java | 15 +-
.../log4j/core/script/ScriptManager.java | 65 +-
.../logging/log4j/core/script/ScriptRef.java | 13 +-
.../core/selector/BasicContextSelector.java | 131 +--
.../core/selector/CoreContextSelectors.java | 25 +
.../core/selector/JndiContextSelector.java | 2 +-
.../logging/log4j/core/tools/Generate.java | 5 +-
.../logging/log4j/core/util/ArrayUtils.java | 124 +++
.../apache/logging/log4j/core/util/Assert.java | 38 -
.../core/util/BasicCommandLineArguments.java | 47 +
.../logging/log4j/core/util/CachedClock.java | 2 +-
.../core/util/CloseShieldOutputStream.java | 3 +
.../apache/logging/log4j/core/util/Closer.java | 4 +-
.../log4j/core/util/CoarseCachedClock.java | 2 +-
.../logging/log4j/core/util/Constants.java | 23 +-
.../logging/log4j/core/util/CronExpression.java | 180 +--
.../logging/log4j/core/util/CyclicBuffer.java | 4 +-
.../util/DefaultShutdownCallbackRegistry.java | 14 +-
.../logging/log4j/core/util/DummyNanoClock.java | 96 +-
.../log4j/core/util/ExecutorServices.java | 81 ++
.../core/util/ExtensionLanguageMapping.java | 6 +-
.../logging/log4j/core/util/FileUtils.java | 4 +-
.../logging/log4j/core/util/FileWatcher.java | 2 +-
.../log4j/core/util/InetAddressConverter.java | 35 +
.../logging/log4j/core/util/JndiCloser.java | 118 +-
.../logging/log4j/core/util/JsonUtils.java | 14 +-
.../apache/logging/log4j/core/util/Loader.java | 29 +-
.../logging/log4j/core/util/Log4jThread.java | 138 +--
.../log4j/core/util/Log4jThreadFactory.java | 93 ++
.../log4j/core/util/NullOutputStream.java | 20 +-
.../log4j/core/util/OptionConverter.java | 3 +-
.../logging/log4j/core/util/ReflectionUtil.java | 2 +-
.../logging/log4j/core/util/StringEncoder.java | 14 +-
.../logging/log4j/core/util/Throwables.java | 60 +-
.../logging/log4j/core/util/TypeUtil.java | 21 +
.../logging/log4j/core/util/WatchManager.java | 36 +-
.../core/util/datetime/FastDateParser.java | 54 +-
.../core/util/datetime/FixedDateFormat.java | 741 +++++++------
.../log4j/core/util/datetime/FormatCache.java | 2 +-
log4j-core/src/main/resources/Log4j-config.xsd | 3 +-
.../log4j/FilterPerformanceComparison.java | 124 ++-
.../log4j/FormatterLoggerManualExample.java | 7 +-
.../apache/logging/log4j/LogRolloverTest.java | 18 +-
.../logging/log4j/MarkerMixInXmlTest.java | 2 +-
.../logging/log4j/ThreadContextTestAccess.java | 34 +
.../log4j/core/BasicConfigurationFactory.java | 6 +-
.../apache/logging/log4j/core/DeadlockTest.java | 2 +-
.../core/GcFreeAsynchronousLoggingTest.java | 4 +-
.../log4j/core/GcFreeLoggingTestUtil.java | 35 +-
.../core/GcFreeMixedSyncAyncLoggingTest.java | 4 +-
.../core/GcFreeSynchronousLoggingTest.java | 4 +-
.../apache/logging/log4j/core/HostNameTest.java | 4 +-
.../logging/log4j/core/Log4j1222Test.java | 2 +-
.../apache/logging/log4j/core/LogEventTest.java | 4 +-
.../apache/logging/log4j/core/LoggerTest.java | 14 +-
.../logging/log4j/core/LoggerUpdateTest.java | 2 +-
.../logging/log4j/core/PatternSelectorTest.java | 32 +-
.../log4j/core/PropertiesFileConfigTest.java | 2 +-
.../core/ShutdownTimeoutConfigurationTest.java | 44 +
.../logging/log4j/core/StrictXmlConfigTest.java | 1 -
.../AsyncAppenderQueueFullPolicyTest.java | 48 +-
.../log4j/core/appender/AsyncAppenderTest.java | 46 +-
.../ConsoleAppenderAnsiMessagesMain.java | 110 +-
.../ConsoleAppenderAnsiStyleJira180Main.java | 119 +-
.../ConsoleAppenderAnsiStyleJira272Main.java | 121 +-
.../ConsoleAppenderAnsiStyleJira319Main.java | 123 ++-
.../ConsoleAppenderAnsiStyleLayoutMain.java | 131 ++-
.../ConsoleAppenderAnsiStyleNameLayoutMain.java | 11 +-
.../appender/ConsoleAppenderBuilderTest.java | 49 +
...nsoleAppenderDefaultSuppressedThrowable.java | 131 ++-
...nsoleAppenderHighlightLayoutDefaultMain.java | 11 +-
...nsoleAppenderHighlightLayoutLogbackMain.java | 11 +-
.../ConsoleAppenderHighlightLayoutMain.java | 11 +-
.../ConsoleAppenderJAnsiMessageMain.java | 79 ++
.../ConsoleAppenderJAnsiXExceptionMain.java | 76 ++
.../ConsoleAppenderNoAnsiStyleLayoutMain.java | 145 ++-
.../core/appender/ConsoleAppenderTest.java | 43 +-
.../CsvJsonParameterLayoutFileAppenderTest.java | 117 ++
.../core/appender/FileAppenderBuilderTest.java | 31 +
.../log4j/core/appender/FileAppenderTest.java | 342 +++---
.../log4j/core/appender/HangingAppender.java | 21 +-
.../core/appender/InMemoryAppenderTest.java | 4 +-
.../log4j/core/appender/Jira739Test.java | 103 +-
.../appender/JsonCompleteFileAppenderTest.java | 37 +-
.../appender/MemoryMappedFileManagerTest.java | 25 +-
.../core/appender/OutputStreamAppenderTest.java | 213 ++--
.../core/appender/ProgressConsoleTest.java | 7 +-
.../appender/RandomAccessFileAppenderTests.java | 2 +-
.../appender/RandomAccessFileManagerTest.java | 26 +-
.../appender/ScriptAppenderSelectorTest.java | 100 ++
.../appender/SocketAppenderBufferSizeTest.java | 77 ++
.../appender/SocketAppenderBuilderTest.java | 32 +
.../log4j/core/appender/SocketAppenderTest.java | 254 +++--
.../core/appender/SyslogAppenderTestBase.java | 2 +-
.../appender/XmlCompleteFileAppenderTest.java | 68 +-
.../db/AbstractDatabaseAppenderTest.java | 145 +--
.../db/AbstractDatabaseManagerTest.java | 356 +++---
.../db/jdbc/AbstractJdbcAppenderTest.java | 34 +-
.../db/jdbc/DataSourceConnectionSourceTest.java | 17 +-
.../jdbc/FactoryMethodConnectionSourceTest.java | 53 +-
.../db/jpa/AbstractJpaAppenderTest.java | 14 +-
.../core/appender/db/jpa/JpaH2AppenderTest.java | 28 +-
.../db/jpa/JpaHyperSqlAppenderTest.java | 28 +-
.../core/appender/db/jpa/TestBaseEntity.java | 7 +
.../ContextDataAttributeConverterTest.java | 70 ++
.../ContextDataJsonAttributeConverterTest.java | 84 ++
.../ContextStackJsonAttributeConverterTest.java | 19 +-
.../log4j/core/appender/mom/JmsAppenderIT.java | 2 +-
.../appender/mom/jeromq/JeroMqAppenderTest.java | 263 ++---
.../appender/mom/kafka/KafkaAppenderTest.java | 292 ++---
.../core/appender/rolling/FileSizeTest.java | 4 +-
.../rolling/OnStartupTriggeringPolicyTest.java | 96 +-
.../RandomRollingAppenderOnStartupTest.java | 105 ++
.../RollingAppenderCronOnceADayTest.java | 125 +++
.../rolling/RollingAppenderCronTest.java | 73 +-
.../RollingAppenderCustomDeleteActionTest.java | 40 +-
...lingAppenderDeleteAccumulatedCount1Test.java | 53 +-
...lingAppenderDeleteAccumulatedCount2Test.java | 53 +-
...ollingAppenderDeleteAccumulatedSizeTest.java | 32 +-
.../RollingAppenderDeleteMaxDepthTest.java | 52 +-
.../RollingAppenderDeleteNestedTest.java | 53 +-
.../RollingAppenderDeleteScriptFri13thTest.java | 37 +-
.../RollingAppenderDeleteScriptTest.java | 35 +-
...ollingAppenderNoUnconditionalDeleteTest.java | 12 +-
.../rolling/RollingAppenderOnStartupTest.java | 105 ++
.../rolling/RollingAppenderSizeTest.java | 115 +-
.../rolling/RollingAppenderTimeAndSizeTest.java | 31 +-
.../rolling/RollingAppenderTimeTest.java | 36 +-
.../RollingAppenderUncompressedTest.java | 28 +-
.../rolling/RollingFileAppenderAccessTest.java | 58 +-
.../rolling/RollingFileAppenderBuilderTest.java | 32 +
.../rolling/RollingFileAppenderLayoutTest.java | 39 +
...RandomAccessFileManagerHeaderFooterTest.java | 30 +-
.../RollingRandomAccessFileManagerTest.java | 155 ++-
.../rolling/action/CountingCondition.java | 124 +--
.../rolling/action/DeleteActionTest.java | 238 ++--
.../rolling/action/DeletingVisitorTest.java | 270 ++---
.../appender/rolling/action/DurationTest.java | 298 ++---
.../appender/rolling/action/FixedCondition.java | 88 +-
.../action/IfAccumulatedFileCountTest.java | 150 +--
.../action/IfAccumulatedFileSizeTest.java | 260 ++---
.../rolling/action/IfLastModifiedTest.java | 194 ++--
.../action/PathSortByModificationTimeTest.java | 186 ++--
.../rolling/action/ScriptConditionTest.java | 260 ++---
.../rolling/action/SortingVisitorTest.java | 188 ++--
.../routing/DefaultRouteScriptAppenderTest.java | 152 +++
.../routing/JsonRoutingAppender2Test.java | 16 +-
.../routing/JsonRoutingAppenderTest.java | 16 +-
.../routing/PropertiesRoutingAppenderTest.java | 23 +-
.../routing/RoutesScriptAppenderTest.java | 159 +++
.../appender/routing/RoutingAppenderTest.java | 11 +-
.../routing/RoutingAppenderWithJndiTest.java | 6 +-
.../routing/RoutingAppenderWithPurgingTest.java | 45 +-
.../routing/RoutingDefaultAppenderTest.java | 32 +-
.../AbstractAsyncThreadContextTestBase.java | 188 ++++
.../async/AsyncLoggerClassLoadDeadlock.java | 32 +
.../async/AsyncLoggerClassLoadDeadlockTest.java | 45 +
.../log4j/core/async/AsyncLoggerConfigTest.java | 8 +-
...oggerConfigThreadContextCopyOnWriteTest.java | 26 +
...yncLoggerConfigThreadContextDefaultTest.java | 26 +
...oggerConfigThreadContextGarbageFreeTest.java | 26 +
.../core/async/AsyncLoggerTestNanoTime.java | 2 +-
...AsyncLoggerThreadContextCopyOnWriteTest.java | 40 +
.../AsyncLoggerThreadContextDefaultTest.java | 40 +
...AsyncLoggerThreadContextGarbageFreeTest.java | 40 +
.../async/AsyncQueueFullPolicyFactoryTest.java | 4 +-
.../async/DefaultAsyncQueueFullPolicyTest.java | 10 +-
.../DiscardingAsyncQueueFullPolicyTest.java | 30 +-
.../core/async/RingBufferLogEventTest.java | 41 +-
.../core/async/perftest/AbstractRunQueue.java | 91 ++
.../core/async/perftest/PerfTestDriver.java | 4 +-
.../core/async/perftest/ResponseTimeTest.java | 43 +-
.../core/async/perftest/RunConversant.java | 31 +
.../log4j/core/async/perftest/RunJCTools.java | 32 +
.../core/async/perftest/SimplePerfTest.java | 28 +-
.../core/config/AbstractLog4j2_1100Test.java | 136 +--
.../config/AppenderControlArraySetTest.java | 12 +-
.../core/config/CompositeConfigurationTest.java | 74 +-
.../log4j/core/config/ConfigurationTest.java | 8 +-
.../log4j/core/config/ConfiguratorTest.java | 91 +-
.../core/config/CustomConfigurationTest.java | 16 +-
.../log4j/core/config/LoggerConfigTest.java | 102 ++
.../core/config/MissingRootLoggerTest.java | 2 +-
.../logging/log4j/core/config/PropertyTest.java | 85 ++
.../log4j/core/config/TestConfigurator.java | 44 +-
.../core/config/TestConfiguratorError.java | 13 +-
.../logging/log4j/core/config/XIncludeTest.java | 2 +-
.../builder/ConfigurationAssemblerTest.java | 48 +-
.../builder/ConfigurationBuilderTest.java | 99 ++
.../builder/CustomConfigurationFactory.java | 24 +-
.../plugins/util/PluginManagerPackagesTest.java | 12 +-
.../util/ResolverUtilCustomProtocolTest.java | 210 ++++
.../config/plugins/util/ResolverUtilTest.java | 132 ++-
.../AbstractPluginWithGenericBuilder.java | 59 +
.../PluginWithGenericSubclassFoo1Builder.java | 71 ++
.../plugins/validation/ValidatingPlugin.java | 2 +-
.../ValidatingPluginWithGenericBuilder.java | 75 ++
.../ValidatingPluginWithTypedBuilder.java | 70 ++
.../validators/RequiredValidatorTest.java | 1 +
.../ValidatingPluginWithGenericBuilderTest.java | 66 ++
...luginWithGenericSubclassFoo1BuilderTest.java | 68 ++
.../ValidatingPluginWithTypedBuilderTest.java | 71 ++
...opertiesConfigurationRootLoggerOnlyTest.java | 10 +-
.../properties/PropertiesConfigurationTest.java | 10 +-
.../properties/RollingFilePropertiesTest.java | 10 +-
.../core/config/xml/XmlLoggerPropsTest.java | 8 +-
.../log4j/core/filter/AbstractFilterTest.java | 88 ++
.../core/filter/AbstractFilterableTest.java | 287 +++++
.../core/filter/AbstractScriptFilterTest.java | 8 +-
.../log4j/core/filter/BurstFilterTest.java | 283 +++--
.../core/filter/DynamicThresholdFilterTest.java | 47 +-
.../log4j/core/filter/LevelRangeFilterTest.java | 9 +
...actoryPropertySetMissingConstructorTest.java | 41 +
.../impl/ContextDataFactoryPropertySetTest.java | 49 +
.../log4j/core/impl/ContextDataFactoryTest.java | 47 +
.../log4j/core/impl/FactoryTestStringMap.java | 104 ++
...ctoryTestStringMapWithoutIntConstructor.java | 100 ++
.../core/impl/JdkMapAdapterStringMapTest.java | 883 +++++++++++++++
.../core/impl/Log4jLogEventNanoTimeTest.java | 2 +-
.../log4j/core/impl/Log4jLogEventTest.java | 96 +-
.../log4j/core/impl/MutableLogEventTest.java | 42 +-
.../impl/NestedLoggingFromToStringTest.java | 132 +++
.../core/impl/ReusableLogEventFactoryTest.java | 42 +-
.../core/impl/ThrowableFormatOptionsTest.java | 211 +++-
.../log4j/core/impl/ThrowableProxyTest.java | 62 +-
.../log4j/core/jackson/LevelMixInJsonTest.java | 2 +-
.../jackson/StackTraceElementMixInTest.java | 3 +-
.../core/layout/AbstractStringLayoutTest.java | 72 ++
.../core/layout/CsvLogEventLayoutTest.java | 342 +++---
.../layout/CsvParameterLayoutAllAsyncTest.java | 7 +-
.../core/layout/CsvParameterLayoutTest.java | 345 +++---
.../log4j/core/layout/GelfLayoutTest.java | 18 +-
.../log4j/core/layout/HtmlLayoutTest.java | 9 +-
.../log4j/core/layout/JsonLayoutTest.java | 96 +-
.../log4j/core/layout/Log4j2_1482_CoreTest.java | 36 +
.../log4j/core/layout/Log4j2_1482_Test.java | 89 ++
.../log4j/core/layout/LogEventFixtures.java | 10 +-
.../layout/PatternLayoutLookupDateTest.java | 44 +
.../layout/PatternLayoutMainMapLookupTest.java | 128 +--
.../layout/PatternLayoutNoLookupDateTest.java | 42 +
.../log4j/core/layout/PatternLayoutTest.java | 35 +-
.../log4j/core/layout/PatternSelectorTest.java | 130 +--
.../log4j/core/layout/Rfc5424LayoutTest.java | 25 +-
.../log4j/core/layout/SerializedLayoutTest.java | 9 +-
.../core/layout/SpyByteBufferDestination.java | 2 +-
.../core/layout/StringBuilderEncoderTest.java | 6 +-
.../log4j/core/layout/SyslogLayoutTest.java | 11 +-
.../log4j/core/layout/XmlLayoutTest.java | 68 +-
.../log4j/core/layout/YamlLayoutTest.java | 64 +-
.../log4j/core/lookup/Log4jLookupTest.java | 33 +-
.../core/lookup/Log4jLookupWithSpacesTest.java | 35 +-
.../lookup/MainInputArgumentsLookupTest.java | 11 +-
.../lookup/MainInputArgumentsMapLookup.java | 2 +-
.../core/lookup/ResourceBundleLookupTest.java | 4 +-
.../log4j/core/net/SocketReconnectTest.java | 12 +-
.../core/net/mock/MockUdpSyslogServer.java | 6 +-
.../net/server/AbstractSocketServerTest.java | 30 +-
.../core/net/server/SslXmlSocketServerTest.java | 23 +-
.../server/UdpSerializedSocketServerTest.java | 2 +
.../core/net/ssl/KeyStoreConfigurationTest.java | 2 +-
.../core/net/ssl/SslConfigurationTest.java | 4 +-
.../net/ssl/TrustStoreConfigurationTest.java | 2 +-
.../osgi/equinox/EquinoxLoadCoreBundleTest.java | 6 +-
.../osgi/felix/FelixLoadCoreBundleTest.java | 4 +
.../core/pattern/DatePatternConverterTest.java | 24 +-
...qualsIgnoreCaseReplacementConverterTest.java | 2 +-
.../pattern/EqualsReplacementConverterTest.java | 2 +-
.../core/pattern/HighlightConverterTest.java | 78 ++
.../core/pattern/MdcPatternConverterTest.java | 29 +-
.../core/pattern/MessageJansiConverterTest.java | 62 ++
.../pattern/MessagePatternConverterTest.java | 17 +-
.../pattern/MessageStyledConverterTest.java | 62 ++
.../core/pattern/NdcPatternConverterTest.java | 77 ++
.../log4j/core/pattern/NoConsoleNoAnsiTest.java | 4 +-
.../log4j/core/pattern/PatternParserTest.java | 24 +-
.../pattern/RegexReplacementConverterTest.java | 4 +-
.../core/pattern/RegexReplacementTest.java | 23 +-
.../SequenceNumberPatternConverterTest.java | 51 +
.../log4j/core/pattern/StyleConverterTest.java | 4 +-
...riablesNotEmptyReplacementConverterTest.java | 2 +-
.../log4j/core/util/CronExpressionTest.java | 32 +-
.../logging/log4j/core/util/Profiler.java | 5 +-
.../core/util/ShutdownCallbackRegistryTest.java | 2 +-
.../logging/log4j/core/util/ThrowablesTest.java | 4 +-
.../log4j/core/util/WatchManagerTest.java | 20 +-
.../core/util/datetime/FixedDateFormatTest.java | 35 +-
.../junit/AbstractExternalFileCleaner.java | 151 +++
.../apache/logging/log4j/junit/CleanFiles.java | 62 +-
.../logging/log4j/junit/CleanFolders.java | 76 ++
.../logging/log4j/junit/LoggerContextRule.java | 216 ++--
.../junit/URLStreamHandlerFactoryRule.java | 97 ++
...MutableLogEventWithReusableParamMsgTest.java | 53 +
.../logging/log4j/test/ExtendedLevels.java | 2 +-
.../log4j/test/appender/AlwaysFailAppender.java | 3 +-
.../log4j/test/appender/BlockingAppender.java | 18 +-
.../log4j/test/appender/DeadlockAppender.java | 12 +-
.../test/appender/EncodingListAppender.java | 12 +-
.../log4j/test/appender/FailOnceAppender.java | 3 +-
.../log4j/test/appender/InMemoryAppender.java | 7 +-
.../log4j/test/appender/ListAppender.java | 93 +-
.../test/appender/UsesLoggingAppender.java | 3 +-
.../logging/log4j/test/layout/BasicLayout.java | 6 +-
.../AsyncLoggerConfigThreadContextTest.xml | 50 +
.../test/resources/AsyncLoggerConsoleTest.xml | 16 +
.../resources/AsyncLoggerThreadContextTest.xml | 8 +-
.../BlockingQueueFactory-ArrayBlockingQueue.xml | 40 +
...ckingQueueFactory-DisruptorBlockingQueue.xml | 40 +
...lockingQueueFactory-JCToolsBlockingQueue.xml | 40 +
...BlockingQueueFactory-LinkedTransferQueue.xml | 40 +
.../src/test/resources/JeroMqAppenderTest.xml | 62 +-
.../SequenceNumberPatternConverterTest.yml | 15 +
.../src/test/resources/configPropertyTest.xml | 38 +
log4j-core/src/test/resources/gcFreeLogging.xml | 17 +-
.../resources/gcFreeMixedSyncAsyncLogging.xml | 20 +-
.../src/test/resources/log4j-advertiser.xml | 4 +-
.../log4j-appender-selector-groovy.xml | 35 +
.../log4j-appender-selector-javascript.xml | 35 +
.../test/resources/log4j-asynch-queue-full.xml | 4 +-
.../log4j-comp-logger-attr-override.json | 38 +
.../test/resources/log4j-comp-logger-root.xml | 44 +
.../src/test/resources/log4j-comp-logger.json | 8 +-
.../test/resources/log4j-comp-root-loggers.xml | 46 +
log4j-core/src/test/resources/log4j-console.xml | 29 +
.../src/test/resources/log4j-customLevel.xml | 7 +-
.../test/resources/log4j-cvs-json-parameter.xml | 32 +
log4j-core/src/test/resources/log4j-empty.xml | 20 +
.../src/test/resources/log4j-list-nolookups.xml | 29 +
.../src/test/resources/log4j-loggerprops.xml | 4 +-
.../src/test/resources/log4j-message-ansi.xml | 34 +
.../src/test/resources/log4j-message-styled.xml | 34 +
.../test/resources/log4j-rolling-7z-lazy.xml | 59 +
.../src/test/resources/log4j-rolling-7z.xml | 58 +
.../test/resources/log4j-rolling-bzip2-lazy.xml | 60 +
.../resources/log4j-rolling-cron-once-a-day.xml | 47 +
.../src/test/resources/log4j-rolling-cron.xml | 2 +-
.../src/test/resources/log4j-rolling-cron2.xml | 2 +-
.../resources/log4j-rolling-deflate-lazy.xml | 60 +
.../test/resources/log4j-rolling-gz-lazy.xml | 59 +
.../resources/log4j-rolling-pack200-lazy.xml | 60 +
.../test/resources/log4j-rolling-xz-lazy.xml | 60 +
.../test/resources/log4j-rolling-zip-lazy.xml | 60 +
.../src/test/resources/log4j-rolling.properties | 24 +-
...og4j-routing-default-route-script-groovy.xml | 40 +
...-routing-default-route-script-javascript.xml | 40 +
.../log4j-routing-routes-script-groovy.xml | 40 +
.../log4j-routing-routes-script-javascript.xml | 40 +
.../log4j-routing-script-staticvars-groovy.xml | 50 +
...g4j-routing-script-staticvars-javascript.xml | 50 +
log4j-core/src/test/resources/log4j-style.xml | 4 +-
.../src/test/resources/log4j-sync-to-list.xml | 35 +
.../resources/log4j-test-shutdownTimeout.xml | 38 +
log4j-core/src/test/resources/log4j-test4.xml | 36 +
log4j-core/src/test/resources/log4j-test5.xml | 36 +
log4j-core/src/test/resources/log4j2-1482.xml | 27 +
log4j-core/src/test/resources/log4j2-1573.xml | 12 +
.../test/resources/log4j2-console-msg-ansi.xml | 31 +
.../log4j2-console-xex-ansi-custom.xml | 31 +
.../resources/log4j2-console-xex-ansi-kirk.xml | 31 +
.../test/resources/log4j2-console-xex-ansi.xml | 31 +
.../test/resources/log4j2-properties.properties | 1 +
log4j-distribution/.gitignore | 2 -
log4j-distribution/pom.xml | 24 +-
log4j-flume-ng/.gitignore | 4 -
log4j-flume-ng/pom.xml | 3 +-
.../flume/appender/AbstractFlumeManager.java | 2 +-
.../log4j/flume/appender/FlumeAppender.java | 56 +-
.../log4j/flume/appender/FlumeAvroManager.java | 6 +-
.../flume/appender/FlumeEmbeddedManager.java | 554 +++++-----
.../log4j/flume/appender/FlumeEvent.java | 10 +
.../log4j/flume/appender/FlumeEventFactory.java | 3 +-
.../flume/appender/FlumePersistentManager.java | 90 +-
.../log4j/flume/appender/FlumeAppenderTest.java | 50 +-
.../flume/appender/FlumeEmbeddedAgentTest.java | 4 +-
.../appender/FlumeEmbeddedAppenderTest.java | 4 +-
.../appender/FlumePersistentAppenderTest.java | 4 +-
.../flume/appender/FlumePersistentPerf.java | 4 +-
log4j-iostreams/.gitignore | Bin 69 -> 0 bytes
log4j-iostreams/pom.xml | 6 +-
.../io/AbstractLoggerOutputStreamTest.java | 15 +-
.../log4j/io/AbstractLoggerWriterTest.java | 15 +-
log4j-jcl/.gitignore | 4 -
log4j-jcl/pom.xml | 2 +-
.../apache/logging/log4j/jcl/LoggerTest.java | 130 +--
log4j-jmx-gui/.gitignore | 4 -
log4j-jmx-gui/pom.xml | 3 +-
log4j-jul/.gitignore | 3 -
log4j-jul/pom.xml | 3 +-
.../org/apache/logging/log4j/jul/Constants.java | 1 +
.../logging/log4j/jul/CoreLoggerAdapter.java | 7 +-
.../logging/log4j/jul/AbstractLoggerTest.java | 4 +-
log4j-liquibase/.gitignore | 3 -
log4j-liquibase/pom.xml | 2 +-
.../ext/logging/log4j2/LoggingTest.java | 12 +-
log4j-nosql/.gitignore | 4 -
log4j-nosql/pom.xml | 13 +-
.../log4j/nosql/appender/NoSqlAppender.java | 3 +-
.../nosql/appender/NoSqlDatabaseManager.java | 7 +-
.../nosql/appender/couchdb/CouchDbProvider.java | 4 +-
.../nosql/appender/mongodb/MongoDbProvider.java | 10 +-
.../log4j/nosql/appender/NoSqlAppenderTest.java | 30 +-
.../appender/NoSqlDatabaseManagerTest.java | 434 +++-----
log4j-perf/.gitignore | 4 -
log4j-perf/perf.txt | 23 -
log4j-perf/pom.xml | 10 +-
.../log4j/ThreadContextBenchmarkAccess.java | 34 +
.../message/ParameterFormatterBenchmark.java | 40 +-
...ractStringLayoutStringEncodingBenchmark.java | 34 +-
.../perf/jmh/AsyncAppenderLog4j2Benchmark.java | 37 +-
.../AsyncAppenderLog4j2LocationBenchmark.java | 25 +-
.../perf/jmh/AsyncAppenderLogbackBenchmark.java | 1 -
.../AsyncAppenderLogbackLocationBenchmark.java | 2 -
.../perf/jmh/AsyncLoggersLocationBenchmark.java | 2 -
.../log4j/perf/jmh/CollectionsBenchmark.java | 12 +-
.../log4j/perf/jmh/FileAppenderBenchmark.java | 10 +-
.../perf/jmh/FileAppenderParamsBenchmark.java | 10 +-
.../log4j/perf/jmh/JdbcAppenderBenchmark.java | 4 +-
.../log4j/perf/jmh/JpaAppenderBenchmark.java | 4 +-
.../jmh/Log4j2AppenderComparisonBenchmark.java | 24 +-
.../log4j/perf/jmh/LoggerConfigBenchmark.java | 2 +-
.../log4j/perf/jmh/MDCFilterBenchmark.java | 14 +-
.../jmh/MemoryHandlerJULLocationBenchmark.java | 4 +-
.../perf/jmh/ParameterizedMessageBenchmark.java | 2 +-
.../ParameterizedMessageInliningBenchmark.java | 20 +-
.../jmh/PatternLayoutComparisonBenchmark.java | 2 +-
.../perf/jmh/SortedArrayVsHashMapBenchmark.java | 239 ++++
.../log4j/perf/jmh/StringEncodingBenchmark.java | 30 +-
.../perf/jmh/TextEncoderHelperBenchmark.java | 12 +-
.../log4j/perf/jmh/ThreadContextBenchmark.java | 201 ++++
...ThreadLocalVsConcurrentHashMapBenchmark.java | 6 +-
.../perf/jmh/ThreadLocalVsPoolBenchmark.java | 16 +-
.../perf/jmh/ThreadsafeDateFormatBenchmark.java | 10 +-
.../logging/log4j/perf/jmh/UnboxBenchmark.java | 91 ++
.../log4j/perf/jmh/VarargsBenchmark.java | 6 +-
.../logging/log4j/perf/nogc/AbstractLogger.java | 6 +-
.../logging/log4j/perf/nogc/ClassicLogger.java | 2 +-
.../logging/log4j/perf/nogc/DemoAppender.java | 12 +-
.../logging/log4j/perf/nogc/NoGcLayout.java | 16 +-
.../logging/log4j/perf/nogc/NoGcLogger.java | 2 +-
.../logging/log4j/perf/nogc/NoGcMessage.java | 10 +-
.../log4j/perf/nogc/OpenHashStringMap.java | 938 ++++++++++++++++
.../log4j/perf/nogc/ParameterizedMessage.java | 6 +-
.../apache/logging/log4j/perf/nogc/Test.java | 24 +-
.../logging/log4j/perf/util/DemoAppender.java | 10 +-
.../CopyOnWriteOpenHashMapThreadContextMap.java | 46 +
.../GarbageFreeOpenHashMapThreadContextMap.java | 49 +
.../resources/log4j2-appenderComparison.xml | 6 +
.../perf5AsyncApndDsrptrNoLoc-noOpAppender.xml | 32 +
...perf5AsyncApndDsrptrWithLoc-noOpAppender.xml | 32 +
.../perf5AsyncApndMpscQNoLoc-noOpAppender.xml | 32 +
.../perf5AsyncApndMpscQWithLoc-noOpAppender.xml | 32 +
.../perf5AsyncApndNoLoc-noOpAppender.xml | 1 +
.../perf5AsyncApndXferQNoLoc-noOpAppender.xml | 32 +
.../perf5AsyncApndXferQWithLoc-noOpAppender.xml | 32 +
log4j-samples/.gitignore | 5 -
log4j-samples/configuration/pom.xml | 2 +-
.../configuration/CustomConfiguration.java | 13 +-
.../CustomConfigurationFactory.java | 12 +-
log4j-samples/flume-common/pom.xml | 2 +-
log4j-samples/flume-embedded/pom.xml | 2 +-
log4j-samples/flume-remote/pom.xml | 2 +-
log4j-samples/loggerProperties/pom.xml | 2 +-
.../logging/log4j/lookup/CustomLookup.java | 8 +-
.../logging/log4j/lookup/CustomMapMessage.java | 2 +-
.../logging/log4j/lookup/MapMessageLookup.java | 10 +-
.../logging/log4j/CustomPropertiesTest.java | 8 +-
log4j-samples/pom.xml | 3 +-
log4j-samples/scala-api/.gitignore | 3 +
log4j-samples/scala-api/pom.xml | 65 ++
.../scala-api/src/main/resources/log4j2.xml | 32 +
.../logging/log4j/scalasample/LoggingApp.scala | 47 +
log4j-slf4j-impl/.gitignore | 4 -
log4j-slf4j-impl/pom.xml | 7 +-
.../org/apache/logging/slf4j/Log4j1222Test.java | 1 -
.../logging/slf4j/Log4j2_1482_Slf4jTest.java | 41 +
.../org/apache/logging/slf4j/LoggerTest.java | 364 +++----
.../org/apache/logging/slf4j/OptionalTest.java | 138 +--
.../src/test/resources/log4j2-1482.xml | 27 +
log4j-taglib/.gitignore | 4 -
log4j-taglib/pom.xml | 2 +-
.../log4j/taglib/Log4jTaglibLoggerContext.java | 4 +-
log4j-to-slf4j/.gitignore | 4 -
log4j-to-slf4j/pom.xml | 2 +-
.../org/apache/logging/slf4j/MDCContextMap.java | 33 +-
.../logging/slf4j/SLF4JLoggerContext.java | 4 +-
log4j-web/.gitignore | 4 -
log4j-web/pom.xml | 7 +-
.../log4j/web/Log4jServletContextListener.java | 42 +-
.../log4j/web/Log4jWebInitializerImpl.java | 550 +++++-----
.../log4j/web/ServletRequestThreadContext.java | 24 +-
.../org/apache/logging/log4j/web/WebLookup.java | 8 -
.../log4j/web/appender/ServletAppender.java | 104 +-
log4j-web/src/site/xdoc/index.xml | 16 -
.../Log4jServletContainerInitializerTest.java | 164 ++-
.../web/Log4jServletContextListenerTest.java | 58 +-
.../log4j/web/Log4jServletFilterTest.java | 114 +-
.../log4j/web/Log4jWebInitializerImplTest.java | 367 ++-----
.../logging/log4j/web/ServletAppenderTest.java | 1 +
.../resources/WEB-INF/classes/log4j-servlet.xml | 64 +-
pom.xml | 127 ++-
src/changes/announcement.vm | 50 +-
src/changes/changes.xml | 451 +++++++-
src/site/apt/download.apt.vm | 15 +
.../resources/images/IntelliJ-IDEA-logo.png | Bin 0 -> 4299 bytes
src/site/resources/images/logo.png | Bin 0 -> 36964 bytes
src/site/resources/logo/logo-3d-green-bg-2.png | Bin 0 -> 33619 bytes
src/site/resources/logo/logo-3d-green-bg-2.xcf | Bin 0 -> 58311 bytes
src/site/resources/logo/logo-3d-green-bg.png | Bin 0 -> 32865 bytes
src/site/resources/logo/logo-3d-green-bg.xcf | Bin 0 -> 58333 bytes
src/site/resources/logo/logo-big-blue.png | Bin 0 -> 30347 bytes
src/site/resources/logo/logo-big-blue.xcf | Bin 0 -> 55133 bytes
src/site/resources/logo/logo-blue-web-r2.6.png | Bin 0 -> 38268 bytes
src/site/resources/logo/logo-blue-web-r2.6.xcf | Bin 0 -> 64192 bytes
src/site/resources/logo/logo-blue-web.png | Bin 0 -> 35254 bytes
src/site/resources/logo/logo-blue-web.xcf | Bin 0 -> 63386 bytes
.../resources/logo/logo-chocolate-swirl-2.png | Bin 0 -> 31842 bytes
.../resources/logo/logo-chocolate-swirl-2.xcf | Bin 0 -> 58254 bytes
.../resources/logo/logo-chocolate-swirl.png | Bin 0 -> 34753 bytes
.../resources/logo/logo-chocolate-swirl.xcf | Bin 0 -> 64646 bytes
src/site/resources/logo/logo-craters-2.png | Bin 0 -> 30522 bytes
src/site/resources/logo/logo-craters-2.xcf | Bin 0 -> 58393 bytes
src/site/resources/logo/logo-craters.png | Bin 0 -> 32590 bytes
src/site/resources/logo/logo-craters.xcf | Bin 0 -> 58716 bytes
src/site/resources/logo/logo-electric-blue.png | Bin 0 -> 31853 bytes
src/site/resources/logo/logo-electric-blue.xcf | Bin 0 -> 58321 bytes
src/site/resources/logo/logo-granite-2.png | Bin 0 -> 33714 bytes
src/site/resources/logo/logo-granite-2.xcf | Bin 0 -> 58695 bytes
src/site/resources/logo/logo-granite.png | Bin 0 -> 31959 bytes
src/site/resources/logo/logo-granite.xcf | Bin 0 -> 58354 bytes
src/site/resources/logo/logo-ice.png | Bin 0 -> 33947 bytes
src/site/resources/logo/logo-ice.xcf | Bin 0 -> 64835 bytes
src/site/resources/logo/logo-java-1.png | Bin 0 -> 33698 bytes
src/site/resources/logo/logo-java-1.xcf | Bin 0 -> 58663 bytes
src/site/resources/logo/logo-java-2-2.6.2.png | Bin 0 -> 40736 bytes
src/site/resources/logo/logo-java-2-2.6.2.xcf | Bin 0 -> 66719 bytes
src/site/resources/logo/logo-java-2.png | Bin 0 -> 36999 bytes
src/site/resources/logo/logo-java-2.xcf | Bin 0 -> 64767 bytes
src/site/resources/logo/logo-java-3.png | Bin 0 -> 33016 bytes
src/site/resources/logo/logo-java-3.xcf | Bin 0 -> 58335 bytes
src/site/resources/logo/logo-leather-2.png | Bin 0 -> 33766 bytes
src/site/resources/logo/logo-leather-2.xcf | Bin 0 -> 58757 bytes
src/site/resources/logo/logo-leather.png | Bin 0 -> 32668 bytes
src/site/resources/logo/logo-leather.xcf | Bin 0 -> 58406 bytes
.../resources/logo/logo-lightning-2.6.1.png | Bin 0 -> 41622 bytes
.../resources/logo/logo-lightning-2.6.1.xcf | Bin 0 -> 65630 bytes
src/site/resources/logo/logo-lightning.png | Bin 0 -> 38593 bytes
src/site/resources/logo/logo-lightning.xcf | Bin 0 -> 64749 bytes
src/site/resources/logo/logo-marble-1.png | Bin 0 -> 33208 bytes
src/site/resources/logo/logo-marble-1.xcf | Bin 0 -> 64833 bytes
src/site/resources/logo/logo-paper-1.png | Bin 0 -> 33016 bytes
src/site/resources/logo/logo-paper-1.xcf | Bin 0 -> 58337 bytes
src/site/resources/logo/logo-paper-2.png | Bin 0 -> 33082 bytes
src/site/resources/logo/logo-paper-2.xcf | Bin 0 -> 58324 bytes
src/site/resources/logo/logo-parque-1.png | Bin 0 -> 33676 bytes
src/site/resources/logo/logo-parque-1.xcf | Bin 0 -> 58334 bytes
src/site/resources/logo/logo-parque-2.png | Bin 0 -> 32530 bytes
src/site/resources/logo/logo-parque-2.xcf | Bin 0 -> 58370 bytes
src/site/resources/logo/logo-parque-3.png | Bin 0 -> 32927 bytes
src/site/resources/logo/logo-parque-3.xcf | Bin 0 -> 58348 bytes
src/site/resources/logo/logo-pastel-stuff-2.png | Bin 0 -> 33441 bytes
src/site/resources/logo/logo-pastel-stuff-2.xcf | Bin 0 -> 58354 bytes
src/site/resources/logo/logo-pastel-stuff-3.png | Bin 0 -> 33194 bytes
src/site/resources/logo/logo-pastel-stuff-3.xcf | Bin 0 -> 58367 bytes
src/site/resources/logo/logo-pastel-stuff.png | Bin 0 -> 37102 bytes
src/site/resources/logo/logo-pastel-stuff.xcf | Bin 0 -> 64784 bytes
src/site/resources/logo/logo-pine.png | Bin 0 -> 28260 bytes
src/site/resources/logo/logo-pine.xcf | Bin 0 -> 61254 bytes
.../resources/logo/logo-pool-bottom-2.7.png | Bin 0 -> 36964 bytes
src/site/resources/logo/logo-pool-bottom-bg.png | Bin 0 -> 31480 bytes
src/site/resources/logo/logo-pool-bottom-bg.xcf | Bin 0 -> 58386 bytes
src/site/resources/logo/logo-pool-bottom.png | Bin 0 -> 33961 bytes
src/site/resources/logo/logo-pool-bottom.xcf | Bin 0 -> 64819 bytes
src/site/resources/logo/logo-qbert.png | Bin 0 -> 34606 bytes
src/site/resources/logo/logo-qbert.xcf | Bin 0 -> 64777 bytes
src/site/resources/logo/logo-rain.png | Bin 0 -> 34527 bytes
src/site/resources/logo/logo-rain.xcf | Bin 0 -> 64686 bytes
src/site/resources/logo/logo-red-cubes.png | Bin 0 -> 32485 bytes
src/site/resources/logo/logo-red-cubes.xcf | Bin 0 -> 58334 bytes
src/site/resources/logo/logo-rocks.png | Bin 0 -> 39238 bytes
src/site/resources/logo/logo-rocks.xcf | Bin 0 -> 64798 bytes
src/site/resources/logo/logo-sky.png | Bin 0 -> 33307 bytes
src/site/resources/logo/logo-sky.xcf | Bin 0 -> 64206 bytes
src/site/resources/logo/logo-starfield.png | Bin 0 -> 30603 bytes
src/site/resources/logo/logo-starfield.xcf | Bin 0 -> 56479 bytes
src/site/resources/logo/logo-stone.png | Bin 0 -> 39696 bytes
src/site/resources/logo/logo-stone.xcf | Bin 0 -> 64755 bytes
src/site/resources/logo/logo-tree-bark.png | Bin 0 -> 40313 bytes
src/site/resources/logo/logo-tree-bark.xcf | Bin 0 -> 64751 bytes
src/site/resources/logo/logo-walnut.png | Bin 0 -> 35644 bytes
src/site/resources/logo/logo-walnut.xcf | Bin 0 -> 64852 bytes
src/site/resources/logo/logo-wood-1.png | Bin 0 -> 34322 bytes
src/site/resources/logo/logo-wood-1.xcf | Bin 0 -> 64867 bytes
src/site/resources/logo/logo-wood-2.png | Bin 0 -> 33795 bytes
src/site/resources/logo/logo-wood-2.xcf | Bin 0 -> 64846 bytes
src/site/resources/logo/logo-wood.png | Bin 0 -> 37241 bytes
src/site/resources/logo/logo-wood.xcf | Bin 0 -> 64930 bytes
src/site/resources/logo/logo.jpg | Bin 0 -> 14818 bytes
src/site/site.vm | 8 +-
src/site/site.xml | 21 +-
src/site/xdoc/articles.xml | 100 +-
src/site/xdoc/faq.xml | 71 +-
src/site/xdoc/index.xml | 142 ---
src/site/xdoc/index.xml.vm | 164 +++
src/site/xdoc/javadoc.xml | 4 +
src/site/xdoc/manual/appenders.xml | 388 ++++++-
src/site/xdoc/manual/async.xml | 13 +-
src/site/xdoc/manual/configuration.xml.vm | 192 +++-
src/site/xdoc/manual/customconfig.xml | 10 +-
src/site/xdoc/manual/customloglevels.xml.vm | 6 +
src/site/xdoc/manual/extending.xml | 153 ++-
src/site/xdoc/manual/filters.xml | 19 +-
src/site/xdoc/manual/garbagefree.xml | 47 +-
src/site/xdoc/manual/index.xml | 2 +-
src/site/xdoc/manual/layouts.xml.vm | 192 +++-
src/site/xdoc/manual/lookups.xml | 18 +-
src/site/xdoc/manual/messages.xml | 38 +-
src/site/xdoc/manual/plugins.xml | 2 +-
src/site/xdoc/manual/scala-api.xml | 91 ++
src/site/xdoc/manual/thread-context.xml | 16 +
src/site/xdoc/manual/webapp.xml | 26 +
src/site/xdoc/maven-artifacts.xml.vm | 32 +
src/site/xdoc/runtime-dependencies.xml | 22 +-
1048 files changed, 46346 insertions(+), 16888 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/39e28336/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java
----------------------------------------------------------------------
diff --cc log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java
index dab2c4e,ded641c..fdfc033
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java
@@@ -55,9 -56,31 +56,18 @@@ public class KafkaManager extends Abstr
}
@Override
- public void releaseSub() {
+ public boolean releaseSub(final long timeout, final TimeUnit timeUnit) {
+ if (timeout > 0) {
+ closeProducer(timeout, timeUnit);
+ } else {
+ closeProducer(timeoutMillis, TimeUnit.MILLISECONDS);
+ }
+ return true;
+ }
+
+ private void closeProducer(final long timeout, final TimeUnit timeUnit) {
if (producer != null) {
- // This thread is a workaround for this Kafka issue: https://issues.apache.org/jira/browse/KAFKA-1660
- final Runnable task = new Runnable() {
- @Override
- public void run() {
- if (producer != null) {
- producer.close();
- }
- }
- };
- try {
- getLoggerContext().submitDaemon(task).get(timeout, timeUnit);
- } catch (InterruptedException | ExecutionException | TimeoutException e) {
- // ignore
- }
+ producer.close(timeoutMillis, TimeUnit.MILLISECONDS);
}
}
[03/50] [abbrv] logging-log4j2 git commit: [LOG4J2-1619] new
Log4jLogEvent().toString() throws an NPE.
Posted by mi...@apache.org.
[LOG4J2-1619] new Log4jLogEvent().toString() throws an NPE.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/e6781f5e
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e6781f5e
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e6781f5e
Branch: refs/heads/LOG4J2-1390
Commit: e6781f5e5789fed20fc4b0cbc3edb6c30dc012c5
Parents: 10a3443
Author: Gary Gregory <gg...@apache.org>
Authored: Wed Sep 28 16:12:13 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Sep 28 16:12:13 2016 -0700
----------------------------------------------------------------------
.../java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java | 2 +-
src/changes/changes.xml | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e6781f5e/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
index 291687a..4759976 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
@@ -741,7 +741,7 @@ public class Log4jLogEvent implements LogEvent {
final String n = loggerName.isEmpty() ? LoggerConfig.ROOT : loggerName;
sb.append("Logger=").append(n);
sb.append(" Level=").append(level.name());
- sb.append(" Message=").append(message.getFormattedMessage());
+ sb.append(" Message=").append(message == null ? null : message.getFormattedMessage());
return sb.toString();
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e6781f5e/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 553f101..6c5d2cd 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -180,6 +180,9 @@
<action issue="LOG4J2-1610" dev="ggregory" type="fix" due-to="Shubhankar">
Add targetNamespace to log4j-config.xsd. GitHub #43.
</action>
+ <action issue="LOG4J2-1619" dev="ggregory" type="fix">
+ new Log4jLogEvent().toString() throws an NPE.
+ </action>
<action issue="LOG4J2-1578" dev="ggregory" type="add">
RoutingAppender can be configured with scripts. Add Script in a Routes element.
</action>
[42/50] [abbrv] logging-log4j2 git commit: Merge branch 'master' into
LOG4J2-1623
Posted by mi...@apache.org.
Merge branch 'master' into LOG4J2-1623
# Conflicts:
# src/changes/changes.xml
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/19418b37
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/19418b37
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/19418b37
Branch: refs/heads/LOG4J2-1390
Commit: 19418b37df948609a8852a17f206076048043f6f
Parents: 6482da5 197997a
Author: Mikael St�ldal <mi...@magine.com>
Authored: Mon Oct 17 13:14:16 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Mon Oct 17 13:14:16 2016 +0200
----------------------------------------------------------------------
.../logging/log4j/util/PropertiesUtil.java | 597 ++++++++++---------
.../log4j/core/appender/AbstractAppender.java | 8 +
.../log4j/core/appender/ConsoleAppender.java | 23 +-
.../core/appender/MemoryMappedFileAppender.java | 2 +-
.../logging/log4j/core/layout/HtmlLayout.java | 81 +--
.../logging/log4j/core/lookup/JndiLookup.java | 5 +-
.../appender/ConsoleAppenderBuilderTest.java | 80 ++-
pom.xml | 2 +-
src/changes/changes.xml | 11 +-
9 files changed, 446 insertions(+), 363 deletions(-)
----------------------------------------------------------------------
[11/50] [abbrv] logging-log4j2 git commit: Make sure to not use zero
timeout for KafkaManager shutdown
Posted by mi...@apache.org.
Make sure to not use zero timeout for KafkaManager shutdown
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/78cbb44d
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/78cbb44d
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/78cbb44d
Branch: refs/heads/LOG4J2-1390
Commit: 78cbb44ddbbf9f7a80156b555041e41414fa8b1b
Parents: 166d3fa
Author: Mikael St�ldal <mi...@magine.com>
Authored: Thu Sep 29 14:04:36 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Thu Sep 29 14:04:36 2016 +0200
----------------------------------------------------------------------
.../log4j/core/appender/mom/kafka/KafkaManager.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/78cbb44d/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java
index 9302beb..ded641c 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/mom/kafka/KafkaManager.java
@@ -57,6 +57,15 @@ public class KafkaManager extends AbstractManager {
@Override
public boolean releaseSub(final long timeout, final TimeUnit timeUnit) {
+ if (timeout > 0) {
+ closeProducer(timeout, timeUnit);
+ } else {
+ closeProducer(timeoutMillis, TimeUnit.MILLISECONDS);
+ }
+ return true;
+ }
+
+ private void closeProducer(final long timeout, final TimeUnit timeUnit) {
if (producer != null) {
// This thread is a workaround for this Kafka issue: https://issues.apache.org/jira/browse/KAFKA-1660
final Runnable task = new Runnable() {
@@ -73,7 +82,6 @@ public class KafkaManager extends AbstractManager {
// ignore
}
}
- return true;
}
public void send(final byte[] msg) throws ExecutionException, InterruptedException, TimeoutException {
[46/50] [abbrv] logging-log4j2 git commit: Upgrade to Commons Lang 3.5
Posted by mi...@apache.org.
Upgrade to Commons Lang 3.5
Related to LOG4J2-1647.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f3e9ea13
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f3e9ea13
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f3e9ea13
Branch: refs/heads/LOG4J2-1390
Commit: f3e9ea13fad1de7e2723f73cdf90810f62776ed2
Parents: d5e4578
Author: Matt Sicker <bo...@gmail.com>
Authored: Sun Oct 23 10:22:17 2016 -0500
Committer: Matt Sicker <bo...@gmail.com>
Committed: Sun Oct 23 10:22:17 2016 -0500
----------------------------------------------------------------------
pom.xml | 2 +-
src/changes/changes.xml | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f3e9ea13/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 66b3bf7..be4d7e4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -287,7 +287,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.4</version>
+ <version>3.5</version>
</dependency>
<dependency>
<groupId>com.beust</groupId>
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f3e9ea13/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 1c63572..4e0eb6e 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -39,6 +39,9 @@
<action issue="LOG4J2-1641" dev="ggregory" type="update">
Update JeroMQ from 0.3.5 to 0.3.6.
</action>
+ <action issue="LOG4J2-1647" dev="mattsicker" type="update">
+ Update Commons Lang from 3.4 to 4.5.
+ </action>
</release>
<release version="2.7" date="2016-10-02" description="GA Release 2.7">
<action issue="LOG4J2-1618" dev="rpopma" type="fix" due-to="Raman Gupta">
[08/50] [abbrv] logging-log4j2 git commit: Minor format tweak.
Posted by mi...@apache.org.
Minor format tweak.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/60e47cb0
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/60e47cb0
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/60e47cb0
Branch: refs/heads/LOG4J2-1390
Commit: 60e47cb0781a4dbe27e6f127447a494bd7208703
Parents: 3a45025
Author: Gary Gregory <gg...@apache.org>
Authored: Wed Sep 28 19:39:14 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Sep 28 19:39:14 2016 -0700
----------------------------------------------------------------------
log4j-jul/src/main/java/org/apache/logging/log4j/jul/Constants.java | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/60e47cb0/log4j-jul/src/main/java/org/apache/logging/log4j/jul/Constants.java
----------------------------------------------------------------------
diff --git a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/Constants.java b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/Constants.java
index ad645b3..bc86410 100644
--- a/log4j-jul/src/main/java/org/apache/logging/log4j/jul/Constants.java
+++ b/log4j-jul/src/main/java/org/apache/logging/log4j/jul/Constants.java
@@ -29,6 +29,7 @@ public final class Constants {
* {@code log4j-core}.
*/
public static final String LOGGER_ADAPTOR_PROPERTY = "log4j.jul.LoggerAdapter";
+
/**
* The Log4j property to set to a custom implementation of {@link org.apache.logging.log4j.jul.LevelConverter}. The specified class must have
* a default constructor.
[28/50] [abbrv] logging-log4j2 git commit: Javadoc: Use the active
voice.
Posted by mi...@apache.org.
Javadoc: Use the active voice.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/1e322e4f
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/1e322e4f
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/1e322e4f
Branch: refs/heads/LOG4J2-1390
Commit: 1e322e4f2b51dc72f12eafea9e12335c65f59e59
Parents: ce86130
Author: Gary Gregory <gg...@apache.org>
Authored: Wed Oct 5 11:29:11 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Oct 5 11:29:11 2016 -0700
----------------------------------------------------------------------
.../java/org/apache/logging/log4j/core/util/CyclicBuffer.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1e322e4f/log4j-core/src/main/java/org/apache/logging/log4j/core/util/CyclicBuffer.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/CyclicBuffer.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/CyclicBuffer.java
index 35b7eb5..0edc65e 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/CyclicBuffer.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/CyclicBuffer.java
@@ -31,7 +31,7 @@ public final class CyclicBuffer<T> {
private final Class<T> clazz;
/**
- * Instantiate a new CyclicBuffer of at most <code>maxSize</code> events.
+ * Instantiates a new CyclicBuffer of at most <code>maxSize</code> events.
* @param clazz The Class associate with the type of object in the buffer.
* @param size The number of items in the buffer.
* @throws IllegalArgumentException if the size is negative.
@@ -50,7 +50,7 @@ public final class CyclicBuffer<T> {
}
/**
- * Add an item as the last event in the buffer.
+ * Adds an item as the last event in the buffer.
* @param item The item to add to the buffer.
*/
public synchronized void add(final T item) {
[24/50] [abbrv] logging-log4j2 git commit: LOG4J2-1623 Fix XML schema
for configuration file
Posted by mi...@apache.org.
LOG4J2-1623 Fix XML schema for configuration file
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/2153a262
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/2153a262
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/2153a262
Branch: refs/heads/LOG4J2-1390
Commit: 2153a2621a7ccfa8e9eb006ae8482e8d8dfbc6bc
Parents: 705e272
Author: Mikael St�ldal <mi...@magine.com>
Authored: Tue Oct 4 12:04:15 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Tue Oct 4 12:04:15 2016 +0200
----------------------------------------------------------------------
log4j-core/src/main/resources/Log4j-config.xsd | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/2153a262/log4j-core/src/main/resources/Log4j-config.xsd
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/resources/Log4j-config.xsd b/log4j-core/src/main/resources/Log4j-config.xsd
index af13d71..e75cb9e 100644
--- a/log4j-core/src/main/resources/Log4j-config.xsd
+++ b/log4j-core/src/main/resources/Log4j-config.xsd
@@ -38,6 +38,7 @@
<xs:attribute name="strict" type="xs:string"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="advertiser" type="xs:string"/>
+ <xs:attribute name="shutdownTimeout" type="xs:string" use="optional"/>
<xs:attribute name="schema" type="xs:string"/>
</xs:complexType>
<xs:complexType name="PropertiesType">
[12/50] [abbrv] logging-log4j2 git commit: Make sure to not use zero
timeout for FlumePersistentManager shutdown
Posted by mi...@apache.org.
Make sure to not use zero timeout for FlumePersistentManager shutdown
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/81eeff13
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/81eeff13
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/81eeff13
Branch: refs/heads/LOG4J2-1390
Commit: 81eeff13e83b98aec8338b8461322df5a71d78d9
Parents: 78cbb44
Author: Mikael St�ldal <mi...@magine.com>
Authored: Thu Sep 29 18:25:02 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Thu Sep 29 18:25:02 2016 +0200
----------------------------------------------------------------------
.../flume/appender/FlumePersistentManager.java | 28 +++++++++-----------
1 file changed, 13 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/81eeff13/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumePersistentManager.java
----------------------------------------------------------------------
diff --git a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumePersistentManager.java b/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumePersistentManager.java
index 4711ae0..82fede1 100644
--- a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumePersistentManager.java
+++ b/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumePersistentManager.java
@@ -31,10 +31,21 @@ import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
-
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
+import com.sleepycat.je.Cursor;
+import com.sleepycat.je.CursorConfig;
+import com.sleepycat.je.Database;
+import com.sleepycat.je.DatabaseConfig;
+import com.sleepycat.je.DatabaseEntry;
+import com.sleepycat.je.Environment;
+import com.sleepycat.je.EnvironmentConfig;
+import com.sleepycat.je.LockConflictException;
+import com.sleepycat.je.LockMode;
+import com.sleepycat.je.OperationStatus;
+import com.sleepycat.je.StatsConfig;
+import com.sleepycat.je.Transaction;
import org.apache.flume.Event;
import org.apache.flume.event.SimpleEvent;
import org.apache.logging.log4j.LoggingException;
@@ -49,19 +60,6 @@ import org.apache.logging.log4j.core.util.Log4jThreadFactory;
import org.apache.logging.log4j.core.util.SecretKeyProvider;
import org.apache.logging.log4j.util.Strings;
-import com.sleepycat.je.Cursor;
-import com.sleepycat.je.CursorConfig;
-import com.sleepycat.je.Database;
-import com.sleepycat.je.DatabaseConfig;
-import com.sleepycat.je.DatabaseEntry;
-import com.sleepycat.je.Environment;
-import com.sleepycat.je.EnvironmentConfig;
-import com.sleepycat.je.LockConflictException;
-import com.sleepycat.je.LockMode;
-import com.sleepycat.je.OperationStatus;
-import com.sleepycat.je.StatsConfig;
-import com.sleepycat.je.Transaction;
-
/**
* Manager that persists data to Berkeley DB before passing it on to Flume.
*/
@@ -220,7 +218,7 @@ public class FlumePersistentManager extends FlumeAvroManager {
LOGGER.debug("Shutting down FlumePersistentManager");
worker.shutdown();
final long requestedTimeoutMillis = timeUnit.toMillis(timeout);
- final long shutdownWaitMillis = requestedTimeoutMillis < 0 ? SHUTDOWN_WAIT_MILLIS : requestedTimeoutMillis;
+ final long shutdownWaitMillis = requestedTimeoutMillis > 0 ? requestedTimeoutMillis : SHUTDOWN_WAIT_MILLIS;
try {
worker.join(shutdownWaitMillis);
} catch (final InterruptedException ie) {
[26/50] [abbrv] logging-log4j2 git commit: LOG4J2-1623 Update
documentation
Posted by mi...@apache.org.
LOG4J2-1623 Update documentation
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/5564556c
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/5564556c
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/5564556c
Branch: refs/heads/LOG4J2-1390
Commit: 5564556cd81be70926d6f35a2ff323f623728f5a
Parents: 9446525
Author: Mikael St�ldal <mi...@magine.com>
Authored: Wed Oct 5 13:35:41 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Wed Oct 5 13:35:41 2016 +0200
----------------------------------------------------------------------
.../org/apache/logging/log4j/core/LoggerContext.java | 12 ++++++++++++
src/site/xdoc/manual/configuration.xml.vm | 9 +++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5564556c/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
index c964965..2681485 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
@@ -302,6 +302,18 @@ public class LoggerContext extends AbstractLifeCycle
stop();
}
+ /**
+ * How many milliseconds appenders and other plugins will get to shutdown.
+ *
+ * Not all plugins will honor this, it is a hint and not an absolute guarantee that the this method not block longer.
+ * Setting timeout too low increase the risk of losing outstanding log events not yet written to the final
+ * destination.
+ *
+ * @param timeout the maximum time to wait, or 0 which mean that each plugin uses its default timeout
+ * @param timeUnit the time unit of the timeout argument
+ * @return true if the context was stopped cleanly and normally, false otherwise.
+ * @since 2.7
+ */
@Override
public boolean stop(final long timeout, final TimeUnit timeUnit) {
LOGGER.debug("Stopping LoggerContext[name={}, {}]...", getName(), this);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/5564556c/src/site/xdoc/manual/configuration.xml.vm
----------------------------------------------------------------------
diff --git a/src/site/xdoc/manual/configuration.xml.vm b/src/site/xdoc/manual/configuration.xml.vm
index acd41fd..2b59e8d 100644
--- a/src/site/xdoc/manual/configuration.xml.vm
+++ b/src/site/xdoc/manual/configuration.xml.vm
@@ -409,8 +409,13 @@ public class Bar {
</tr>
<tr>
<td>shutdownTimeout</td>
- <td>Specifies how many milliseconds appenders and other plugins will get to shutdown when the JVM shuts down.
- Default is zero. (Not used if <tt>shutdownHook</tt> is set to "disable".)</td>
+ <td>Specifies how many milliseconds appenders and other plugins will get to shutdown when the JVM shuts
+ down. Default is zero which mean that each plugin uses its default timeout. Not all plugins will honor
+ this, it is a hint and not an absolute guarantee that the shutdown procedure will not take longer.
+ Setting this too low increase the risk of losing outstanding log events not yet written to the final
+ destination. See <a class="javadoc"
+ href="../log4j-core/target/site/apidocs/org/apache/logging/log4j/core/LoggerContext.html#stop(long, java.util.concurrent.TimeUnit)">LoggerContext.stop(long, java.util.concurrent.TimeUnit)</a>.
+ (Not used if <tt>shutdownHook</tt> is set to "disable".)</td>
<tr>
<td>status</td>
<td>The level of internal Log4j events that should be logged to the console.
[27/50] [abbrv] logging-log4j2 git commit: LOG4J2-1623 Update
documentation
Posted by mi...@apache.org.
LOG4J2-1623 Update documentation
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/c92c327c
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/c92c327c
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/c92c327c
Branch: refs/heads/LOG4J2-1390
Commit: c92c327c3db50ff18d01234c0a427d3ad9869588
Parents: 5564556
Author: Mikael St�ldal <mi...@magine.com>
Authored: Wed Oct 5 15:07:55 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Wed Oct 5 15:07:55 2016 +0200
----------------------------------------------------------------------
.../logging/log4j/core/LoggerContext.java | 21 +++++++++++++-------
.../logging/log4j/core/config/Configurator.java | 13 +++++++-----
src/site/xdoc/manual/configuration.xml.vm | 10 +++++-----
3 files changed, 27 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c92c327c/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
index 2681485..4c759c0 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
@@ -303,15 +303,22 @@ public class LoggerContext extends AbstractLifeCycle
}
/**
- * How many milliseconds appenders and other plugins will get to shutdown.
- *
- * Not all plugins will honor this, it is a hint and not an absolute guarantee that the this method not block longer.
+ * Blocks until all Log4j tasks have completed execution after a shutdown request and all appenders have shut down,
+ * or the timeout occurs, or the current thread is interrupted, whichever happens first.
+ * <p>
+ * Not all appenders will honor this, it is a hint and not an absolute guarantee that the this method not block longer.
* Setting timeout too low increase the risk of losing outstanding log events not yet written to the final
* destination.
- *
- * @param timeout the maximum time to wait, or 0 which mean that each plugin uses its default timeout
- * @param timeUnit the time unit of the timeout argument
- * @return true if the context was stopped cleanly and normally, false otherwise.
+ * <p>
+ * Log4j can start threads to perform certain actions like file rollovers, calling this method with a positive timeout will
+ * block until the rollover thread is done.
+ *
+ * @param timeout the maximum time to wait, or 0 which mean that each apppender uses its default timeout, and don't wait for background
+ tasks
+ * @param timeUnit
+ * the time unit of the timeout argument
+ * @return {@code true} if the logger context terminated and {@code false} if the timeout elapsed before
+ * termination.
* @since 2.7
*/
@Override
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c92c327c/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
index 3da469d..28dd85f 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
@@ -346,13 +346,12 @@ public final class Configurator {
}
/**
- * Blocks until all Log4j tasks have completed execution after a shutdown request, or the timeout occurs, or the
- * current thread is interrupted, whichever happens first.
+ * Shuts down the given logger context.
* <p>
- * Log4j can start threads to perform certain actions like file rollovers, calling this method with a timeout will
- * block until the rollover thread is done.
+ * Log4j can start threads to perform certain actions like file rollovers; calling this method with a positive
+ * timeout will block until the rollover thread is done.
* </p>
- *
+ *
* @param ctx
* the logger context to shut down, may be null.
* @param timeout
@@ -361,6 +360,10 @@ public final class Configurator {
* the time unit of the timeout argument
* @return {@code true} if the logger context terminated and {@code false} if the timeout elapsed before
* termination.
+ *
+ * @see LoggerContext#stop(long, TimeUnit)
+ *
+ * @since 2.7
*/
public static boolean shutdown(final LoggerContext ctx, final long timeout, final TimeUnit timeUnit) {
if (ctx != null) {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c92c327c/src/site/xdoc/manual/configuration.xml.vm
----------------------------------------------------------------------
diff --git a/src/site/xdoc/manual/configuration.xml.vm b/src/site/xdoc/manual/configuration.xml.vm
index 2b59e8d..2117dd2 100644
--- a/src/site/xdoc/manual/configuration.xml.vm
+++ b/src/site/xdoc/manual/configuration.xml.vm
@@ -409,11 +409,11 @@ public class Bar {
</tr>
<tr>
<td>shutdownTimeout</td>
- <td>Specifies how many milliseconds appenders and other plugins will get to shutdown when the JVM shuts
- down. Default is zero which mean that each plugin uses its default timeout. Not all plugins will honor
- this, it is a hint and not an absolute guarantee that the shutdown procedure will not take longer.
- Setting this too low increase the risk of losing outstanding log events not yet written to the final
- destination. See <a class="javadoc"
+ <td>Specifies how many milliseconds appenders and background tasks will get to shutdown when the JVM shuts
+ down. Default is zero which mean that each appender uses its default timeout, and don't wait for background
+ tasks. Not all appenders will honor this, it is a hint and not an absolute guarantee that the shutdown
+ procedure will not take longer. Setting this too low increase the risk of losing outstanding log events
+ not yet written to the final destination. See <a class="javadoc"
href="../log4j-core/target/site/apidocs/org/apache/logging/log4j/core/LoggerContext.html#stop(long, java.util.concurrent.TimeUnit)">LoggerContext.stop(long, java.util.concurrent.TimeUnit)</a>.
(Not used if <tt>shutdownHook</tt> is set to "disable".)</td>
<tr>