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 <[email protected]> Authored: Wed May 4 14:12:51 2016 +0200 Committer: Mikael Ståldal <[email protected]> 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(); } }
