Java 的日志組件,SLF4J 1.7.8 發布
簡單日記門面(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.