Java 的日志组件,SLF4J 1.7.8 发布

jopen 10年前

简单日记门面(simple logging Facade for java)SLF4J是为各种loging APIs提供一个简单统一的
接口,从而使得最终用户能够在部署的时候配置自己希望的loging APIs实现。 Logging API实现既可以
选择直接实现SLF4J接的loging APIs如: NLOG4J、SimpleLogger。也可以通过SLF4J提供的API实现
来开发相应的适配器如Log4jLoggerAdapter、JDK14LoggerAdapter。在SLF4J发行版本中包含了几个
jar包,如slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-log4j13.jar,
slf4j-jdk14.jar and slf4j-jcl.jar通过这些jar文件可以使编译期与具体的实现脱离。或者说可以
灵活的切换
二、官方站点
官方的网站:http://www.slf4j.org/manual.html

SLF4J 1.7.8 发布了,该版本可自动检测和报告类和 logger 名称之间的不匹配,详情请看

http://www.slf4j.org/codes.html#loggerNameMismatch

下载地址:

http://www.slf4j.org/download.html

详细改进记录:

  • Spot incorrectly named   loggers by setting the   slf4j.detectLoggerNameMismatch system property to   true.  This significant feature was contributed by Alexander   Dorokhine.

  • Added MDC.putCloseable method so that it can be   used as a closeable   resource under Java 7.

  • Added getContext method returning a hashtable in   org.apache.log4j.MDC in the log4j-over-slf4j module.

  • Added JSR305 @Nonnull annotations in LoggerFactory   class. Further annotations are likely to follow.