How to make Jersey to use SLF4J instead of JUL?

后端 未结 6 735
野的像风
野的像风 2020-12-25 12:22

I\'ve found a useful article that explains how to make Jersey to use SLF4J instead of JUL. Now my unit test looks like (and it works perfectly):

public class         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-25 13:08

    This worked for me:

    public abstract class JerseyTestSFL4J extends JerseyTest {
    
      static {
        // Get JerseyTest to use SLF4J instead of JUL
        SLF4JBridgeHandler.removeHandlersForRootLogger();
        SLF4JBridgeHandler.install();
      }
    }
    

    and then having my tests extend JerseyTestSFL4J.

提交回复
热议问题