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

后端 未结 7 951
借酒劲吻你
借酒劲吻你 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条回答
  • 2020-12-07 18:20

    Just for the sake of completeness, a logback-classic variant:

    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.0.0</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.6.6</version>
        <scope>runtime</scope>
    </dependency>
    

    Do not forget however to disable commons-logging dependency which sprouts from Spring dependency like in the accepted (Stijn's) answer.

    0 讨论(0)
提交回复
热议问题