slf4j + java.util.logging: how to configure?

后端 未结 6 912
孤独总比滥情好
孤独总比滥情好 2021-01-01 09:35

I\'m trying to use slf4j + java.util.logging. I know how to set up the Java source code to do this via logger = LoggerFactory.getLogger(...) and logger.wa

6条回答
  •  再見小時候
    2021-01-01 09:52

    I've dropped Java logging on the same purpose and went for logback. There is nothing to do to configure logback with SLF4J actually. Just put logback.xml to the root of the jar with logback configuration and put logback-XX.jar on classpath.

    
    
      
        
        
          %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
        
      
    
      
        
      
    
    

    This is a config for logging to console, but logback manual has more examples.

提交回复
热议问题