You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/11/08 15:48:17 UTC

logging-log4j2 git commit: LOG4J2-1683 add public method MapMessage::getDataValue(String) allows clients to query the message data map without requiring the map to be wrapped in an java/util/Collections$UnmodifiableMap

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 0413ea68f -> 0ad44bae8


LOG4J2-1683	add public method MapMessage::getDataValue(String) allows clients to query the message data map without requiring the map to be wrapped in an java/util/Collections$UnmodifiableMap


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

Branch: refs/heads/master
Commit: 0ad44bae8c4a9fd467ceaeb7e382861c7852f8ba
Parents: 0413ea6
Author: rpopma <rp...@apache.org>
Authored: Wed Nov 9 00:48:11 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Wed Nov 9 00:48:11 2016 +0900

----------------------------------------------------------------------
 .../org/apache/logging/log4j/message/MapMessage.java     | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0ad44bae/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
index b113ed5..0ec8280 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
@@ -103,6 +103,17 @@ public class MapMessage implements MultiformatMessage {
     }
 
     /**
+     * Returns the value of the specified key in the message data, or {@code null} if the message data does not contain
+     * the specified key.
+     *
+     * @param key the key whose value to look up in the message data
+     * @return the value of the specified key in the message data, or {@code null}
+     */
+    public String getDataValue(String key) {
+        return data.get(key);
+    }
+
+    /**
      * Clear the data.
      */
     public void clear() {