How do I configure Spring and SLF4J so that I can get logging?

后端 未结 7 958
借酒劲吻你
借酒劲吻你 2020-12-07 17:52

I\'ve got a maven & spring app that I want logging in. I\'m keen to use SLF4J.

I want to put all my config files into a directory {classpath}/config including lo

7条回答
  •  萌比男神i
    2020-12-07 18:03

    You'll find an example at https://github.com/mbogoevici/spring-samples/tree/master/mvc-basic/trunk. You need to include some dependencies in your POM file to enable logging.

    
        
            org.slf4j
            slf4j-api
            ${org.slf4j.version}
        
        
            org.slf4j
            jcl-over-slf4j
            ${org.slf4j.version}
            runtime
        
        
            org.slf4j
            slf4j-log4j12
            ${org.slf4j.version}
            runtime
        
        
            log4j
            log4j
            1.2.16
            runtime
        
    

提交回复
热议问题