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

后端 未结 4 1340
隐瞒了意图╮
隐瞒了意图╮ 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:10

    I can't speak about the "believed unpopular" aspect, I can only speak for myself:

    Commons Logging is a facade over top of whatever your "real" logging framework may be: Log4j, Logback or whatever.

    The idea of a logging facade is that your app gains the flexibility to decide at runtime which logging implementation it wants to work with. The facades are clever enough to find logging implementations at runtime.

    My older Java apps use Log4j, directly. Works fine, I see no need to change them. My newer Java apps will probably use Logback. I think the ability to dynamically choose a logging framework is something none of my apps will ever need. Of course, other peoples' mileage may vary.


    EDIT: Looks like I was wrong about the rationale for Commons Logging. The links given by @Pascal Thivent, especially the first one, explain this far better.

提交回复
热议问题