What is the difference between log4j, slf4j and logback?

后端 未结 2 1621
无人共我
无人共我 2020-12-12 17:25

I am little bit confused by these three logger libraries. It seems like that they can do the similar thing in java logging...

2条回答
  •  [愿得一人]
    2020-12-12 17:33

    This link : https://medium.com/@krishankantsinghal/logback-slf4j-log4j2-understanding-them-and-learn-how-to-use-d33deedd0c46

    Explains the differences in detail.

    Quoting from there

    Slf4j

    So Basically Simple Logging Facade for Java serves as a simple facade or abstraction for various logging frameworks allowing the end user to plug in the desired logging framework at deployment time.

    log4j2

    Log4j,Logback and java.util.Logger are logging libraries which actually write the logs and have their own pros and cons. As industry standards are Log4j2 and logback

    I would recommend going through the blog. It provides all the glory details how both are used with adapter.

提交回复
热议问题