What is the issue with the runtime discovery algorithm of Apache Commons Logging

后端 未结 4 1348
隐瞒了意图╮
隐瞒了意图╮ 2020-12-02 05:44

Dave Syer (SpringSource) writes in his blog:

Unfortunately, the worst thing about commons-logging, and what has made it unpopular with new tools, is a

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 06:22

    Commons Logging contains logic to determine at runtime whether to use log4j or java.util.logging.*.

    That code used to be seriously broken, essentially only working with JUL.

    Based on the experiences with this, slf4j was written which uses static binding (or used to, Im not sure with version 1.6) to choose the appropriate framework to use of log4j, JUL or the log4j fork logback (and more), and it includes a bridge to allow existing Commons Logging code to use slf4j transparently.

    If you can, then go for slf4j.

提交回复
热议问题