Changeset 1946 for trunk


Ignore:
Timestamp:
2011-09-05 11:26:26 (9 months ago)
Author:
mpo
Message:

Bridge JULU to Log4j logging during tests.

Location:
trunk/core/kauri-runtime-testfw
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/kauri-runtime-testfw/pom.xml

    r1790 r1946  
    3030      <scope>compile</scope> 
    3131    </dependency> 
     32    <dependency> 
     33      <groupId>org.slf4j</groupId> 
     34      <artifactId>jul-to-slf4j</artifactId> 
     35    </dependency> 
    3236  </dependencies> 
    3337 
  • trunk/core/kauri-runtime-testfw/src/main/java/org/kauriproject/runtime/testfw/AbstractRuntimeTest.java

    r1945 r1946  
    4747import org.restlet.data.Protocol; 
    4848import org.restlet.data.Reference; 
     49import org.restlet.engine.Engine; 
     50import org.slf4j.bridge.SLF4JBridgeHandler; 
    4951 
    5052public abstract class AbstractRuntimeTest extends TestCase { 
     
    213215 
    214216    protected void setUpLogging() { 
     217        // Let Restlet configure its log now, since next we are going to redirect the JDK logging, and otherwise 
     218        // when the Restlet Engine is initialized it will undo that. 
     219        Engine.configureLog(); 
     220 
     221        // Forward JDK logging to SLF4J 
     222        java.util.logging.LogManager.getLogManager().reset(); 
     223        java.util.logging.LogManager.getLogManager().getLogger("").addHandler(new SLF4JBridgeHandler()); 
     224        java.util.logging.LogManager.getLogManager().getLogger("").setLevel(java.util.logging.Level.ALL); 
     225         
    215226        // By passing these system properties, you can easily enable a certain level 
    216227        // of debugging for a certain log category 
Note: See TracChangeset for help on using the changeset viewer.