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/05/04 16:49:45 UTC

[1/7] logging-log4j2 git commit: LogEvent memento

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 0ba569c52 -> 020319b4c


LogEvent memento


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

Branch: refs/heads/master
Commit: 1b134cf3cbd227562fdfa8c4744366e09a03d4c2
Parents: 7c36904
Author: Mikael St�ldal <mi...@magine.com>
Authored: Wed Apr 27 19:04:01 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Wed Apr 27 19:04:01 2016 +0200

----------------------------------------------------------------------
 .../log4j/core/appender/AsyncAppender.java      | 62 +++++++++-----------
 .../logging/log4j/core/impl/Log4jLogEvent.java  | 10 ++++
 .../log4j/core/impl/MutableLogEvent.java        | 11 ++++
 .../core/layout/AbstractJacksonLayout.java      |  2 +-
 .../logging/log4j/core/net/SmtpManager.java     |  2 +-
 .../log4j/test/appender/ListAppender.java       |  2 +-
 6 files changed, 52 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1b134cf3/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 aa10155..72f9ca8 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
@@ -16,14 +16,7 @@
  */
 package org.apache.logging.log4j.core.appender;
 
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.atomic.AtomicLong;
-
+import org.apache.logging.log4j.core.AbstractLogEvent;
 import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.Filter;
 import org.apache.logging.log4j.core.LogEvent;
@@ -35,15 +28,17 @@ import org.apache.logging.log4j.core.config.AppenderControl;
 import org.apache.logging.log4j.core.config.AppenderRef;
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.config.ConfigurationException;
-import org.apache.logging.log4j.core.config.plugins.Plugin;
-import org.apache.logging.log4j.core.config.plugins.PluginAliases;
-import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
-import org.apache.logging.log4j.core.config.plugins.PluginConfiguration;
-import org.apache.logging.log4j.core.config.plugins.PluginElement;
-import org.apache.logging.log4j.core.config.plugins.PluginFactory;
+import org.apache.logging.log4j.core.config.plugins.*;
 import org.apache.logging.log4j.core.impl.Log4jLogEvent;
 import org.apache.logging.log4j.core.util.Constants;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.atomic.AtomicLong;
+
 /**
  * Appends to one or more Appenders asynchronously. You can configure an AsyncAppender with one or more Appenders and an
  * Appender to append to if the queue is full. The AsyncAppender does not allow a filter to be specified on the Appender
@@ -53,11 +48,11 @@ import org.apache.logging.log4j.core.util.Constants;
 public final class AsyncAppender extends AbstractAppender {
 
     private static final int DEFAULT_QUEUE_SIZE = 128;
-    private static final String SHUTDOWN = "Shutdown";
+    private static final LogEvent SHUTDOWN = new AbstractLogEvent() { };
 
     private static final AtomicLong THREAD_SEQUENCE = new AtomicLong(1);
 
-    private final BlockingQueue<Serializable> queue;
+    private final BlockingQueue<LogEvent> queue;
     private final int queueSize;
     private final boolean blocking;
     private final long shutdownTimeout;
@@ -173,19 +168,19 @@ public final class AsyncAppender extends AbstractAppender {
 
     private boolean enqueueOrBlockIfQueueFull(final LogEvent logEvent) {
         boolean appendSuccessful;
-        final Serializable serialized = Log4jLogEvent.serialize(logEvent, includeLocation);
+        final Log4jLogEvent frozenLogEvent = Log4jLogEvent.createMemento(logEvent, includeLocation);
         try {
             // wait for free slots in the queue
-            queue.put(serialized);
+            queue.put(frozenLogEvent);
             appendSuccessful = true;
         } catch (final InterruptedException e) {
-            appendSuccessful = handleInterruptedException(serialized);
+            appendSuccessful = handleInterruptedException(frozenLogEvent);
         }
         return appendSuccessful;
     }
 
     private boolean enqueueOrDropIfQueueFull(final LogEvent logEvent) {
-        final boolean appendSuccessful = queue.offer(Log4jLogEvent.serialize(logEvent, includeLocation));
+        final boolean appendSuccessful = queue.offer(Log4jLogEvent.createMemento(logEvent, includeLocation));
         if (!appendSuccessful) {
             error("Appender " + getName() + " is unable to write primary appenders. queue is full");
         }
@@ -203,8 +198,8 @@ public final class AsyncAppender extends AbstractAppender {
     // This may interfere with the application's expectation of
     // being interrupted, so when we are done, we set the interrupted
     // flag again.
-    private boolean handleInterruptedException(final Serializable serialized) {
-        final boolean appendSuccessful = queue.offer(serialized);
+    private boolean handleInterruptedException(final Log4jLogEvent frozenLogEvent) {
+        final boolean appendSuccessful = queue.offer(frozenLogEvent);
         if (!appendSuccessful) {
             LOGGER.warn("Interrupted while waiting for a free slot in the AsyncAppender LogEvent-queue {}",
                     getName());
@@ -269,9 +264,9 @@ public final class AsyncAppender extends AbstractAppender {
 
         private volatile boolean shutdown = false;
         private final List<AppenderControl> appenders;
-        private final BlockingQueue<Serializable> queue;
+        private final BlockingQueue<LogEvent> queue;
 
-        public AsyncThread(final List<AppenderControl> appenders, final BlockingQueue<Serializable> queue) {
+        public AsyncThread(final List<AppenderControl> appenders, final BlockingQueue<LogEvent> queue) {
             this.appenders = appenders;
             this.queue = queue;
             setDaemon(true);
@@ -281,17 +276,16 @@ public final class AsyncAppender extends AbstractAppender {
         @Override
         public void run() {
             while (!shutdown) {
-                Serializable s;
+                LogEvent event;
                 try {
-                    s = queue.take();
-                    if (s != null && s instanceof String && SHUTDOWN.equals(s.toString())) {
+                    event = queue.take();
+                    if (event == SHUTDOWN) {
                         shutdown = true;
                         continue;
                     }
                 } catch (final InterruptedException ex) {
                     break; // LOG4J2-830
                 }
-                final Log4jLogEvent event = Log4jLogEvent.deserialize(s);
                 event.setEndOfBatch(queue.isEmpty());
                 final boolean success = callAppenders(event);
                 if (!success && errorAppender != null) {
@@ -309,15 +303,15 @@ public final class AsyncAppender extends AbstractAppender {
             int ignored = 0;
             while (!queue.isEmpty()) {
                 try {
-                    final Serializable s = queue.take();
-                    if (Log4jLogEvent.canDeserialize(s)) {
-                        final Log4jLogEvent event = Log4jLogEvent.deserialize(s);
-                        event.setEndOfBatch(queue.isEmpty());
-                        callAppenders(event);
+                    final LogEvent event = queue.take();
+                    if (event instanceof Log4jLogEvent) {
+                        final Log4jLogEvent logEvent = (Log4jLogEvent) event;
+                        logEvent.setEndOfBatch(queue.isEmpty());
+                        callAppenders(logEvent);
                         count++;
                     } else {
                         ignored++;
-                        LOGGER.trace("Ignoring event of class {}", s.getClass().getName());
+                        LOGGER.trace("Ignoring event of class {}", event.getClass().getName());
                     }
                 } catch (final InterruptedException ex) {
                     // May have been interrupted to shut down.

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1b134cf3/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 776fba7..7c9bcbf 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
@@ -670,6 +670,16 @@ public Log4jLogEvent(final String loggerName, final Marker marker, final String
         throw new InvalidObjectException("Proxy required");
     }
 
+    /**
+     * Creates and returns a new immutable copy of this {@code Log4jLogEvent}.
+     *
+     * @return a new immutable copy of the data in this {@code Log4jLogEvent}
+     */
+    public static Log4jLogEvent createMemento(LogEvent event, final boolean includeLocation) {
+        // TODO implement Log4jLogEvent.createMemento()
+        return deserialize(serialize(event, includeLocation));
+    }
+
     @Override
     public String toString() {
         final StringBuilder sb = new StringBuilder();

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1b134cf3/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
index 7fd31c0..be4ba24 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
@@ -415,4 +415,15 @@ public class MutableLogEvent implements LogEvent, ReusableMessage {
     private void readObject(final ObjectInputStream stream) throws InvalidObjectException {
         throw new InvalidObjectException("Proxy required");
     }
+
+    /**
+     * Creates and returns a new immutable copy of this {@code MutableLogEvent}.
+     *
+     * @return a new immutable copy of the data in this {@code MutableLogEvent}
+     */
+    public Log4jLogEvent createMemento() {
+        // TODO implement MutableLogEvent.createMemento()
+        return Log4jLogEvent.deserialize(Log4jLogEvent.serialize(this, includeLocation));
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1b134cf3/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractJacksonLayout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractJacksonLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractJacksonLayout.java
index 22e2d36..b3bad36 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractJacksonLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractJacksonLayout.java
@@ -75,7 +75,7 @@ abstract class AbstractJacksonLayout extends AbstractStringLayout {
         // TODO Need to set up the same filters for MutableLogEvent but don't know how...
         // This is a workaround.
         return event instanceof MutableLogEvent
-                ? Log4jLogEvent.deserialize(Log4jLogEvent.serialize(event, event.isIncludeLocation()))
+                ? ((MutableLogEvent) event).createMemento()
                 : event;
     }
 

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1b134cf3/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SmtpManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SmtpManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SmtpManager.java
index ab1d5c7..6683f1d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SmtpManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SmtpManager.java
@@ -88,7 +88,7 @@ public class SmtpManager extends AbstractManager {
         if (event instanceof Log4jLogEvent && event.getMessage() instanceof ReusableMessage) {
             ((Log4jLogEvent) event).makeMessageImmutable();
         } else if (event instanceof MutableLogEvent) {
-            event = Log4jLogEvent.deserialize(Log4jLogEvent.serialize(event, event.isIncludeLocation()));
+            event = ((MutableLogEvent) event).createMemento();
         }
         buffer.add(event);
     }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/1b134cf3/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 acab7c1..cc897ea 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
@@ -88,7 +88,7 @@ public class ListAppender extends AbstractAppender {
         if (layout == null) {
             if (event instanceof MutableLogEvent) {
                 // must take snapshot or subsequent calls to logger.log() will modify this event
-                events.add(Log4jLogEvent.deserialize(Log4jLogEvent.serialize(event, event.isIncludeLocation())));
+                events.add(((MutableLogEvent) event).createMemento());
             } else {
                 events.add(event);
             }


[4/7] logging-log4j2 git commit: Fix formatting

Posted by mi...@apache.org.
Fix formatting


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

Branch: refs/heads/master
Commit: 6da41bf8be6298b9b859cf56609f434ba10da71e
Parents: 6cb9f99
Author: Mikael St�ldal <mi...@magine.com>
Authored: Wed May 4 13:48:50 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Wed May 4 13:48:50 2016 +0200

----------------------------------------------------------------------
 .../log4j/core/appender/AsyncAppender.java      | 86 +++++++++++---------
 1 file changed, 47 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/6da41bf8/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 72f9ca8..b6670d6 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
@@ -16,6 +16,13 @@
  */
 package org.apache.logging.log4j.core.appender;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.atomic.AtomicLong;
+
 import org.apache.logging.log4j.core.AbstractLogEvent;
 import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.Filter;
@@ -28,17 +35,15 @@ import org.apache.logging.log4j.core.config.AppenderControl;
 import org.apache.logging.log4j.core.config.AppenderRef;
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.config.ConfigurationException;
-import org.apache.logging.log4j.core.config.plugins.*;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+import org.apache.logging.log4j.core.config.plugins.PluginAliases;
+import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
+import org.apache.logging.log4j.core.config.plugins.PluginConfiguration;
+import org.apache.logging.log4j.core.config.plugins.PluginElement;
+import org.apache.logging.log4j.core.config.plugins.PluginFactory;
 import org.apache.logging.log4j.core.impl.Log4jLogEvent;
 import org.apache.logging.log4j.core.util.Constants;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.atomic.AtomicLong;
-
 /**
  * Appends to one or more Appenders asynchronously. You can configure an AsyncAppender with one or more Appenders and an
  * Appender to append to if the queue is full. The AsyncAppender does not allow a filter to be specified on the Appender
@@ -48,7 +53,8 @@ import java.util.concurrent.atomic.AtomicLong;
 public final class AsyncAppender extends AbstractAppender {
 
     private static final int DEFAULT_QUEUE_SIZE = 128;
-    private static final LogEvent SHUTDOWN = new AbstractLogEvent() { };
+    private static final LogEvent SHUTDOWN = new AbstractLogEvent() {
+    };
 
     private static final AtomicLong THREAD_SEQUENCE = new AtomicLong(1);
 
@@ -65,8 +71,9 @@ public final class AsyncAppender extends AbstractAppender {
     private AsyncEventRouter asyncEventRouter;
 
     private AsyncAppender(final String name, final Filter filter, final AppenderRef[] appenderRefs,
-            final String errorRef, final int queueSize, final boolean blocking, final boolean ignoreExceptions,
-            final long shutdownTimeout, final Configuration config, final boolean includeLocation) {
+                          final String errorRef, final int queueSize, final boolean blocking,
+                          final boolean ignoreExceptions,
+                          final long shutdownTimeout, final Configuration config, final boolean includeLocation) {
         super(name, filter, null, ignoreExceptions);
         this.queue = new ArrayBlockingQueue<>(queueSize);
         this.queueSize = queueSize;
@@ -124,7 +131,7 @@ public final class AsyncAppender extends AbstractAppender {
 
         if (DiscardingAsyncEventRouter.getDiscardCount(asyncEventRouter) > 0) {
             LOGGER.trace("AsyncAppender: {} discarded {} events.", asyncEventRouter,
-                    DiscardingAsyncEventRouter.getDiscardCount(asyncEventRouter));
+                DiscardingAsyncEventRouter.getDiscardCount(asyncEventRouter));
         }
     }
 
@@ -202,7 +209,7 @@ public final class AsyncAppender extends AbstractAppender {
         final boolean appendSuccessful = queue.offer(frozenLogEvent);
         if (!appendSuccessful) {
             LOGGER.warn("Interrupted while waiting for a free slot in the AsyncAppender LogEvent-queue {}",
-                    getName());
+                getName());
         }
         // set the interrupted flag again.
         Thread.currentThread().interrupt();
@@ -214,37 +221,38 @@ public final class AsyncAppender extends AbstractAppender {
             errorAppender.callAppender(logEvent);
         }
     }
+
     /**
      * Create an AsyncAppender.
      *
-     * @param appenderRefs The Appenders to reference.
-     * @param errorRef An optional Appender to write to if the queue is full or other errors occur.
-     * @param blocking True if the Appender should wait when the queue is full. The default is true.
-     * @param shutdownTimeout How many milliseconds the Appender should wait to flush outstanding log events
-     *                        in the queue on shutdown. The default is zero which means to wait forever.
-     * @param size The size of the event queue. The default is 128.
-     * @param name The name of the Appender.
-     * @param includeLocation whether to include location information. The default is false.
-     * @param filter The Filter or null.
-     * @param config The Configuration.
+     * @param appenderRefs     The Appenders to reference.
+     * @param errorRef         An optional Appender to write to if the queue is full or other errors occur.
+     * @param blocking         True if the Appender should wait when the queue is full. The default is true.
+     * @param shutdownTimeout  How many milliseconds the Appender should wait to flush outstanding log events
+     *                         in the queue on shutdown. The default is zero which means to wait forever.
+     * @param size             The size of the event queue. The default is 128.
+     * @param name             The name of the Appender.
+     * @param includeLocation  whether to include location information. The default is false.
+     * @param filter           The Filter or null.
+     * @param config           The Configuration.
      * @param ignoreExceptions If {@code "true"} (default) exceptions encountered when appending events are logged;
-     *            otherwise they are propagated to the caller.
+     *                         otherwise they are propagated to the caller.
      * @return The AsyncAppender.
      */
     @PluginFactory
     public static AsyncAppender createAppender(
-            // @formatter:off
-            @PluginElement("AppenderRef") final AppenderRef[] appenderRefs,
-            @PluginAttribute("errorRef") @PluginAliases("error-ref") final String errorRef,
-            @PluginAttribute(value = "blocking", defaultBoolean = true) final boolean blocking,
-            @PluginAttribute(value = "shutdownTimeout", defaultLong = 0L) final long shutdownTimeout,
-            @PluginAttribute(value = "bufferSize", defaultInt = DEFAULT_QUEUE_SIZE) final int size,
-            @PluginAttribute("name") final String name,
-            @PluginAttribute(value = "includeLocation", defaultBoolean = false) final boolean includeLocation,
-            @PluginElement("Filter") final Filter filter,
-            @PluginConfiguration final Configuration config,
-            @PluginAttribute(value = "ignoreExceptions", defaultBoolean = true) final boolean ignoreExceptions) {
-            // @formatter:on
+        // @formatter:off
+        @PluginElement("AppenderRef") final AppenderRef[] appenderRefs,
+        @PluginAttribute("errorRef") @PluginAliases("error-ref") final String errorRef,
+        @PluginAttribute(value = "blocking", defaultBoolean = true) final boolean blocking,
+        @PluginAttribute(value = "shutdownTimeout", defaultLong = 0L) final long shutdownTimeout,
+        @PluginAttribute(value = "bufferSize", defaultInt = DEFAULT_QUEUE_SIZE) final int size,
+        @PluginAttribute("name") final String name,
+        @PluginAttribute(value = "includeLocation", defaultBoolean = false) final boolean includeLocation,
+        @PluginElement("Filter") final Filter filter,
+        @PluginConfiguration final Configuration config,
+        @PluginAttribute(value = "ignoreExceptions", defaultBoolean = true) final boolean ignoreExceptions) {
+        // @formatter:on
         if (name == null) {
             LOGGER.error("No name provided for AsyncAppender");
             return null;
@@ -254,7 +262,7 @@ public final class AsyncAppender extends AbstractAppender {
         }
 
         return new AsyncAppender(name, filter, appenderRefs, errorRef, size, blocking, ignoreExceptions,
-                shutdownTimeout, config, includeLocation);
+            shutdownTimeout, config, includeLocation);
     }
 
     /**
@@ -298,7 +306,7 @@ public final class AsyncAppender extends AbstractAppender {
             }
             // Process any remaining items in the queue.
             LOGGER.trace("AsyncAppender.AsyncThread shutting down. Processing remaining {} queue events.",
-                    queue.size());
+                queue.size());
             int count = 0;
             int ignored = 0;
             while (!queue.isEmpty()) {
@@ -319,7 +327,7 @@ public final class AsyncAppender extends AbstractAppender {
                 }
             }
             LOGGER.trace("AsyncAppender.AsyncThread stopped. Queue has {} events remaining. "
-                    + "Processed {} and ignored {} events since shutdown started.", queue.size(), count, ignored);
+                + "Processed {} and ignored {} events since shutdown started.", queue.size(), count, ignored);
         }
 
         /**


[6/7] logging-log4j2 git commit: Merge branch 'master' into LOG4J2-1347

Posted by mi...@apache.org.
Merge branch 'master' into LOG4J2-1347


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

Branch: refs/heads/master
Commit: 17f984e4a391db16df4fab0622cbf22459429377
Parents: 0fb4ed1 0ba569c
Author: Mikael St�ldal <mi...@magine.com>
Authored: Wed May 4 18:20:40 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Wed May 4 18:20:40 2016 +0200

----------------------------------------------------------------------
 src/site/xdoc/manual/garbagefree.xml |   8 +-
 src/site/xdoc/performance.xml        | 127 +++++++++++++++++++-----------
 2 files changed, 85 insertions(+), 50 deletions(-)
----------------------------------------------------------------------



[7/7] logging-log4j2 git commit: Revert implementing MutableLogEvent.createMemento()

Posted by mi...@apache.org.
Revert implementing MutableLogEvent.createMemento()


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

Branch: refs/heads/master
Commit: 020319b4c465e0526fff9d449363c2ed1c9cfcf5
Parents: 17f984e
Author: Mikael St�ldal <mi...@magine.com>
Authored: Wed May 4 18:48:21 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Wed May 4 18:48:21 2016 +0200

----------------------------------------------------------------------
 .../org/apache/logging/log4j/core/impl/MutableLogEvent.java     | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/020319b4/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
index 3298bca..be4ba24 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
@@ -422,9 +422,8 @@ public class MutableLogEvent implements LogEvent, ReusableMessage {
      * @return a new immutable copy of the data in this {@code MutableLogEvent}
      */
     public Log4jLogEvent createMemento() {
-        Log4jLogEvent.Builder builder = new Log4jLogEvent.Builder(this);
-        builder.setMessage(memento());
-        return builder.build();
+        // TODO implement MutableLogEvent.createMemento()
+        return Log4jLogEvent.deserialize(Log4jLogEvent.serialize(this, includeLocation));
     }
 
 }


[3/7] logging-log4j2 git commit: Merge branch 'master' into LOG4J2-1347

Posted by mi...@apache.org.
Merge branch 'master' into LOG4J2-1347


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

Branch: refs/heads/master
Commit: 6cb9f99271eb2701400928f7a271c0fd162d3cc2
Parents: d9f2a34 acce51a
Author: Mikael St�ldal <mi...@magine.com>
Authored: Wed May 4 13:42:00 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Wed May 4 13:42:00 2016 +0200

----------------------------------------------------------------------
 .../log4j/core/layout/Rfc5424Layout.java        |   5 +-
 .../log4j/core/pattern/NameAbbreviator.java     |  77 ++++++-
 .../log4j/core/layout/PatternLayoutTest.java    | 202 +++++++++++++++++++
 src/changes/changes.xml                         |  10 +-
 .../ResponseTimeAsyncClassicVsGcFree-label.png  | Bin 31517 -> 29217 bytes
 .../ResponseTimeVsServiceTimeAsyncLoggers.png   | Bin 0 -> 34779 bytes
 .../SyncThroughputLoggerComparisonLinux.png     | Bin 0 -> 69223 bytes
 .../garbage-free2.6-SyncThroughputLinux.png     | Bin 70039 -> 65092 bytes
 src/site/xdoc/index.xml                         |   6 +
 src/site/xdoc/manual/garbagefree.xml            |  81 +++++---
 src/site/xdoc/manual/index.xml                  |  10 +-
 src/site/xdoc/manual/layouts.xml.vm             |  34 +++-
 src/site/xdoc/performance.xml                   | 145 +++++++++----
 src/site/xdoc/runtime-dependencies.xml          |  35 ++--
 14 files changed, 507 insertions(+), 98 deletions(-)
----------------------------------------------------------------------



[5/7] logging-log4j2 git commit: Implement MutableLogEvent.createMemento()

Posted by mi...@apache.org.
Implement MutableLogEvent.createMemento()


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

Branch: refs/heads/master
Commit: 0fb4ed116d4ce7d90e43270eec7e00bc656d8fae
Parents: 6da41bf
Author: Mikael St�ldal <mi...@magine.com>
Authored: Wed May 4 14:12:51 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Wed May 4 15:14:29 2016 +0200

----------------------------------------------------------------------
 .../org/apache/logging/log4j/core/impl/MutableLogEvent.java     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0fb4ed11/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
index be4ba24..3298bca 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/MutableLogEvent.java
@@ -422,8 +422,9 @@ public class MutableLogEvent implements LogEvent, ReusableMessage {
      * @return a new immutable copy of the data in this {@code MutableLogEvent}
      */
     public Log4jLogEvent createMemento() {
-        // TODO implement MutableLogEvent.createMemento()
-        return Log4jLogEvent.deserialize(Log4jLogEvent.serialize(this, includeLocation));
+        Log4jLogEvent.Builder builder = new Log4jLogEvent.Builder(this);
+        builder.setMessage(memento());
+        return builder.build();
     }
 
 }


[2/7] logging-log4j2 git commit: Merge branch 'master' into LOG4J2-1347

Posted by mi...@apache.org.
Merge branch 'master' into LOG4J2-1347


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

Branch: refs/heads/master
Commit: d9f2a3447b1b267dbdc5f8d92e16c5d34c21edd2
Parents: 1b134cf 21a9a13
Author: Mikael St�ldal <mi...@magine.com>
Authored: Fri Apr 29 16:32:15 2016 +0200
Committer: Mikael St�ldal <mi...@magine.com>
Committed: Fri Apr 29 16:32:15 2016 +0200

----------------------------------------------------------------------
 README.md                                       |   2 +-
 .../core/async/perftest/ResponseTimeTest.java   |  72 +++++++++++------
 .../ResponseTimeAsyncClassicVsGcFree-label.png  | Bin 0 -> 31517 bytes
 .../images/ResponseTimeSyncClassicVsGcFree.png  | Bin 0 -> 38428 bytes
 src/site/xdoc/manual/appenders.xml              |   4 +-
 src/site/xdoc/manual/garbagefree.xml            |  81 ++++++++++++++++---
 6 files changed, 119 insertions(+), 40 deletions(-)
----------------------------------------------------------------------