Hibernate, Spring and SLF4J Binding

前端 未结 5 1814
囚心锁ツ
囚心锁ツ 2020-12-30 08:28

I\'m trying to setup a webapp with maven2 managed dependcies. Here my pom.xml



        
5条回答
  •  南方客
    南方客 (楼主)
    2020-12-30 09:27

    Include the slf4j-api in your dependencies:

    
      org.slf4j
      slf4j-api
      1.5.8
    
    

    Exclude the commons-logging dependency for minimum one of your declared spring dependencies and provide the slf4j facade for commons-logging:

    
      org.springframework
      spring-context
      3.0.2.RELEASE
      
         
           commons-logging
           commons-logging
         
      
    
    
      org.slf4j
      jcl-over-slf4j
      1.5.8
      runtime
    
    

    Include the log4j dependency for your logging together with the slf4j facade:

    
      org.slf4j
      slf4j-log4j12
      1.5.8
      runtime
    
    
      log4j
      log4j
      1.2.14
      runtime
    
    

    A great blog post for further reading about logging with SLF4J and Spring can be found in the SpringSource Team blog under http://blog.springsource.com/2009/12/04/logging-dependencies-in-spring/.

提交回复
热议问题