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:07:41 UTC

logging-log4j2 git commit: Implement MutableLogEvent.createMemento()

Repository: logging-log4j2
Updated Branches:
  refs/heads/LOG4J2-1347 6da41bf8b -> 0fb4ed116


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/LOG4J2-1347
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();
     }
 
 }