Difference between slf4j-log4j12 and log4j-over-slf4j

前端 未结 1 512
傲寒
傲寒 2021-01-30 19:48

What\'s the difference between slf4j-log4j12 and log4j-over-slf4j and when should each be used?


    &l         


        
1条回答
  •  北海茫月
    2021-01-30 20:37

    log4j-over-slf4j
    

    Use this if your code or some libraries you are using uses Log4j directly, but you want to use a different SLF4J binding than Log4j. It will route the Log4j API calls to SLF4J to the binding you choose. You need to remove the Log4j library from your classpath and replace it with this dependency.

    slf4j-log4j12
    

    Use this if you want to use the Log4j 1.2 binding for SLF4J.

    You shouldn't use both of these libraries at the same time.

    Please note also that Log4j 2 has been released.

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