You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2015/11/03 15:00:19 UTC

svn commit: r1712295 - /sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/logback/integration/ITAppenderServices.java

Author: bdelacretaz
Date: Tue Nov  3 14:00:19 2015
New Revision: 1712295

URL: http://svn.apache.org/viewvc?rev=1712295&view=rev
Log:
Add Appender service test for ROOT logger

Modified:
    sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/logback/integration/ITAppenderServices.java

Modified: sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/logback/integration/ITAppenderServices.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/logback/integration/ITAppenderServices.java?rev=1712295&r1=1712294&r2=1712295&view=diff
==============================================================================
--- sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/logback/integration/ITAppenderServices.java (original)
+++ sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/logback/integration/ITAppenderServices.java Tue Nov  3 14:00:19 2015
@@ -91,6 +91,23 @@ public class ITAppenderServices extends
     }
 
     @Test
+    public void testRootAppenderService() throws Exception {
+        TestAppender ta = registerAppender("ROOT");
+        delay();
+
+        Logger root = (Logger)LoggerFactory.getLogger("ROOT");
+        root.setLevel(Level.DEBUG);
+        Logger foobar = (Logger)LoggerFactory.getLogger("foo.bar");
+        foobar.setLevel(Level.INFO);
+
+        root.debug("one");
+        foobar.debug("two");
+        foobar.info("three");
+
+        assertEquals(2, ta.events.size());
+    }
+
+    @Test
     public void testAppenderServiceModified() throws Exception {
         TestAppender ta = registerAppender("foo.bar", "foo.baz");
         delay();