Spring 中 commons-logging 包
来源:互联网 发布:乐视2root软件 编辑:程序博客网 时间:2024/04/30 16:43
commons-logging.jar包是使用spring的必备包。(位置在spring-framework-2.5.6.SEC01/lib/jakarta-commons)用来记录程序运行时的活动的日志记录。
在java平台中,有几个可以选择的日志记录的实现(log4j,JDK Logging API)。
如果你希望你的日志记录与实现无关,你可以使用Apache CommonsLogging,它使用抽象的API,这些API都是实现无关的,可以让你在不同的日志记录实现之间切换,而不需要修改你的代码。
只要你使用了Apache Commons Logging,你可以在Apache CommonsLogging支持的日志记录实现任意选择(目前主要支持log4j和JDK LoggingAPI),如果使用log4j,拷贝spring-framework-2.5.6.SEC01/lib/log4j下的包到程序里,一旦程序中检测log4j在classpath,Commons Logging将会使用log4j作为底层实现。
你可以可以通过配置在classpath根目录下log4j.properties来配置Log4j。下面log4j配置文件定义了一个日志输出器(log appender)叫做stdout,可以用来输出日志信息到控制台上。想了解更多的Log4J的信息。请参考Log4J
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=
%d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n
### set root logger level ###
log4j.rootLogger=error, stdout
### set application logger level ###
log4j.logger.com.apress.springrecipes.calculator=info
Log4J支持根据紧急度从高到低分为6个日志等级-fatal, error, warn, info, debug,和trace。在上面的配置文件中,程序的根日志级别是error,这就意味着只有error和fatal级别的日志才会默认输出。但是对于com.apress.springrecipes.calculator包和它的子包,只要日志级别高于info才会输出。
- Spring 中 commons-logging 包
- 在spring中引入commons-logging.jar包的目的
- spring中commons-logging.jar的作用
- spring中commons-logging.jar的作用
- spring中commons-logging.jar的作用
- spring中commons-logging.jar的作用
- OSGI中启动spring dm加载的commons-logging问题
- Spring 配置 Apache Commons Logging
- apache commons包下载 (如commons-logging包)
- 在Spring中配置使用commons-logging的simplelog来输出日志
- 在Spring中配置使用commons-logging的simplelog来输出日志
- spring 中使用 logback打印日志,替换其他日志如log4j,commons-logging
- commons-logging
- commons.logging
- commons-logging
- java中commons-logging的使用
- Java Spring Tutorial -- Spring框架和commons-logging
- MAVEN项目中添加jar包httpclient-4.3.5.jar,commons-logging-1.1.1.jar,httpcore-4.3.2.jar
- 浅析ORACLE ERP系统维护方法
- 网页DIV接收键盘按键消息解决办法
- 奔驰(javascript)(用谷歌浏览器解析比较快)
- sicily 1014 Specialized Four-Dig
- HtmlElement 基础知识
- Spring 中 commons-logging 包
- sicily 1046 Plane Spotting
- Android开发——关于全屏显示问题
- 单子解锁
- linux下查看进程并强行关闭杀死进程命令
- 实例讲解iframe之间以及父窗体的函数调用传值
- XT300的GMS包
- 虚拟机中,安装苹果系统Mac.OS.X.10.6.3.Retail.dmg。中午篇11/4.21
- Windows Server 2008 Hyper-v技术浅析