1. 程式人生 > >log4j不列印日誌

log4j不列印日誌

程式碼的日誌內容不列印到日誌檔案

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
 

原因:缺少slf4j-log4j12包

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>1.7.21</version>
    </dependency>

記錄一下問題