使用SLF4J+log4j代替commons-logging
来源:互联网 发布:福禄克网络sn查询 编辑:程序博客网 时间:2024/06/14 10:22
今天上午无聊逛了下Spring的官网,在Spring官方文档的时候发现有这么一条 Not Using Commons Logging
Unfortunately, the runtime discovery algorithm in commons-logging, while convenient for the end-user, is problematic.
Using SLF4J
SLF4J is a cleaner dependency and more efficient at runtime than commons-logging because it uses compile-time bindings instead of runtime discovery of the other logging frameworks it integrates.
SLF4J是一个更清洁和更有效的在运行时的依赖比commons-logging由于它使用编译时绑定,而不是运行时发现的其他日志记录框架集。
Using Log4J
Many people use Log4j as a logging framework for configuration and management purposes.It’s efficient and well-established
<dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>4.3.5.RELEASE</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>1.5.8</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.5.8</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.5.8</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.14</version> </dependency></dependencies>
之前一直在看百度搜的各种文章,其实官方的第一手资料才是最好的,强化一下英语,坚持看第一手资料,共勉!
0 0
- 使用SLF4J+log4j代替commons-logging
- logback,slf4j,log4j, commons-logging
- commons-logging log4j slf4j logback
- Spring使用SLF4J代替Commons Logging写日志
- 让slf4j接管commons-logging,并使用log4j实现
- log4j,slf4j及Commons Logging介绍与原理使用
- slf4j log4j logback JDK14Logger jcl commons-logging...
- 日志组件 commons-logging、slf4j、log4j
- log4j与commons-logging,slf4j的关系
- log4j与commons-logging,slf4j的关系
- log4j与commons-logging,slf4j的关系
- log4j与commons-logging,slf4j的关系
- log4j与commons-logging,slf4j的关系
- 日志记录相关:log4j+slf4j+commons-logging
- log4j与commons-logging,slf4j的关系
- log4j+logback+slf4j+commons-logging的区别
- log4j与commons-logging,slf4j的关系
- log4j与commons-logging,slf4j的关系
- LeetCode278. First Bad Version(二分)
- c库函数之二 - toupper函数
- LeetCode365. Water and Jug Problem(找规律)
- 小程序 使用view实现下拉刷新,上拉加载数据
- undo Segment深入解析
- 使用SLF4J+log4j代替commons-logging
- Android设计模式学习笔记(策略模式)
- Tomcat 修改Linux下tomcat的JVM内存大小
- Android开发人员不得不收集的代码(持续更新中)
- 探究MVVM
- 嵌入式ftp和telnet环境搭建
- source insight代码编辑工具 单机选中之后复制的内容帐帖不过来
- 学生管理系统(增删改查)
- js中的split()方法的使