JUL to SLF4J Bridge

前端 未结 5 1410
小蘑菇
小蘑菇 2020-11-27 11:57

I\'m currently observing that a 3rd party library (namely restfb) is using java.util.logging and I\'m seeing those logs end up in STDOUT even though I don\'t have an SLF4J c

5条回答
  •  猫巷女王i
    2020-11-27 12:20

    My solution :

    SLF4JBridgeHandler.install();
    java.util.logging.LogManager.getLogManager().getLogger("").setLevel( Level.INFO);
    

    placing jul-to-slf4j on your app libs or glassfish libs, these redirect JUL to SLF4J (and thus in my case to LOG4J)

    then for Jersey, you could do something like :

    
        
        
        
       
    
    
        
        
        
    
    

    the last config is to avoid to be polluted by other loggers

提交回复
热议问题