LOG4J2-1447 flume appender changes for the migration of Map<String,String> to ContextData
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/42d6b91a Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/42d6b91a Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/42d6b91a Branch: refs/heads/LOG4J2-1010&LOG4J2-1447-injectable-contextdata&better-datastructure Commit: 42d6b91a413f6614cb8eeacda764035171a2ef4b Parents: 0f402af Author: rpopma <[email protected]> Authored: Wed Jul 27 01:23:28 2016 +0900 Committer: rpopma <[email protected]> Committed: Wed Jul 27 01:23:28 2016 +0900 ---------------------------------------------------------------------- .../apache/logging/log4j/flume/appender/FlumeEvent.java | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/42d6b91a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java ---------------------------------------------------------------------- diff --git a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java b/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java index 769fa74..a56b4e7 100644 --- a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java +++ b/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/FlumeEvent.java @@ -29,6 +29,7 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LoggingException; import org.apache.logging.log4j.Marker; import org.apache.logging.log4j.ThreadContext; +import org.apache.logging.log4j.core.ContextData; import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.impl.ThrowableProxy; import org.apache.logging.log4j.core.util.Patterns; @@ -321,6 +322,15 @@ public class FlumeEvent extends SimpleEvent implements LogEvent { } /** + * Returns the {@code ContextData} of the {@code LogEvent} that this {@code FlumeEvent} was constructed with. + * @return the {@code ContextData} of the {@code LogEvent} that this {@code FlumeEvent} was constructed with. + */ + @Override + public ContextData getContextData() { + return event.getContextData(); + } + + /** * Returns a copy of the context stack. * @return a copy of the context stack. */
