1. 程式人生 > >Logger日誌

Logger日誌

日誌體系

 log4j
 log4j2(mybatis用到)
 jul (javautillogging,spring用到)
 logback(springboot用到)
 jcl(commons-logging)
抽象日誌。
 "org.apache.commons.logging.impl.Log4JLogger",
 "org.apache.commons.logging.impl.Jdk14Logger",
 "org.apache.commons.logging.impl.Jdk13LumberjackLogger",
 "org.apache.commons.logging.impl.SimpleLog"
 Log log = LogFactory.getLog("jcl"); //得到的是log4j物件

 slf4j   (使用log繫結器去繫結log物件) 核心+繫結器
- log4j binding   ---> log4j
- jul binding     ---> jul
- jcl binding     ---> jul log4j...
- logback binding ---> logback

 slf4j 橋接器 
- jcl-over-slf4j    將jcl日誌,改用為slf4j日誌
- log4j-over-slf4j  將log4j日誌,改用slf4j日誌(有問題,需要自己解決)