logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1395143 - /logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java
Date Sat, 06 Oct 2012 18:23:52 GMT
Author: ggregory
Date: Sat Oct  6 18:23:51 2012
New Revision: 1395143

URL: http://svn.apache.org/viewvc?rev=1395143&view=rev
Log:
Work in progress.

Modified:
    logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java

Modified: logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java?rev=1395143&r1=1395142&r2=1395143&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java
Sat Oct  6 18:23:51 2012
@@ -19,9 +19,12 @@ package org.apache.logging.log4j.core;
 import java.net.NetworkInterface;
 import java.net.SocketException;
 import java.nio.charset.Charset;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.message.MapMessage;
 import org.junit.Test;
 
 /**
@@ -33,6 +36,18 @@ public class CollectionLoggingTest {
     public void testSystemProperties() {
         Logger logger = LogManager.getLogger(CollectionLoggingTest.class.getName());
         logger.error(System.getProperties());
+        // logger.error(new MapMessage(System.getProperties()));
+    }
+
+    @Test
+    public void testSimpleMap() {
+        Logger logger = LogManager.getLogger(CollectionLoggingTest.class.getName());
+        logger.error(System.getProperties());
+        Map<String, String> map = new HashMap<String, String>();
+        map.put("MyKey1", "MyValue1");
+        map.put("MyKey2", "MyValue2");
+        logger.error(new MapMessage(map));
+        logger.error(map);
     }
 
     @Test



Mime
View raw message