一 :为什么同时使用commons-logging和Log4j?为什么不仅使用其中之一?
Commons-loggin的目的是为“所有的Java日志实现”提供一个统一的接口,它自身的日志功能平常弱(只有一个简单的SimpleLog?),所以一般不会单独使用它。Log4j的功能非常全面强大,是目前的首选。我发现几乎所有的Java开源项目都会用到Log4j,但我同时发现,所有用到Log4j的项目一般也同时会用到commons-loggin。我想,大家都不希望自己的项目与Log4j绑定的太紧密吧。另外一个我能想到的“同时使用commons-logging和Log4j”的原因是,简化使用和配置。同时减少对Log4j的依赖。
commons-logging:
http://commons.apache.org/logging/
Log4j:
http://logging.apache.org/log4j/1.2/index.html
参考文章:
1.
http://www.blogjava.net/liuwentao253/archive/2006/08/03/61517.html
2.
http://kdboy.iteye.com/blog/208851
分享到:
相关推荐
为什么同时使用commons-logging和Log4j?commons-logging为我们提供了统一的日志接口,可以用各种日志工具类。log4j是目前输出日志的首选。
这是一个讲解commons-logging 和log4j的使用方法,里面有一些例子供大家参考。
NULL 博文链接:https://tianjun309.iteye.com/blog/776137
官网下载,未作任何改动
用户可以自由选择第三方的日志组件作为具体实现,像log4j,或者jdk自带的logging, common-logging会通过动态查找的机制,在程序运行时自动找出真正使用的日志库。当然,common-logging内部有一个Simple logger的...
NULL 博文链接:https://icourses.iteye.com/blog/1839984
log4j日志包 log4j.jar\commons-logging-1.1.1.jar private static final Log log = LogFactory.getLog(xxxxxx.class); 下载后解压就能得到这两个包
Commons-loggin的目的是为“所有的Java日志实现”提供一个统一的接口,它自身的日志功能平常弱(只有一个简单的SimpleLog?...另外一个我能想到的“同时使用commons-logging和Log4j”的原因是,简化使用和配置
配置日志文件时需要的jar包,配置日志文件时需要的jar包,配置日志文件时需要的jar包
log4j 用的两个jar包,log4j-1.2.14.jar 和 commons-logging-1.1.jar
开发工具 commons-logging-1.2开发工具 commons-logging-1.2开发工具 commons-logging-1.2开发工具 commons-logging-1.2开发工具 commons-logging-1.2开发工具 commons-logging-1.2开发工具 commons-logging-1.2开发...
poi-3.6-20091214.jar commons-logging-1.1
When writing a library it is very useful to log information. However there are many logging implementations out there, and a library cannot impose the use of a particular one on the overall ...
日志框架需要的Jar包 commons-logging.jar log4j.jar
NULL 博文链接:https://raozhiyong11.iteye.com/blog/1485880
commons-logging-1.0.4.jar、hessian-3.0.1.jar、log4j-1.2.12.jar
Commons Logging (JCL)提供的是一个日志(Log)接口(interface),同时兼顾轻量级和不依赖于具体的... Because we use commons-logging you are free to choose your logging implementation (Log4j is a common choice).
log4j jdklog commons-logging 关系及简单应用 详情看blog http://blog.csdn.net/harrison2010/archive/2011/02/15/6185819.aspx
commons-logging配合log4j,java log ,打印输出日志必备
log4j 与commonslogging,搭配记录日志是现在最流行的记录日志的方法,两者搭配不仅没有增加日志记录的难度,反而大大简化了记录日志的操作。