使用logback時,出現Maven SLF4J: Class path contains multiple SLF4J bindings
阿新 • • 發佈:2019-02-18
一般出現這種情況是由於logback的版本低所致,升級到高版本,還會出現這個問題,如果確認有多個實現,如下:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/apache-tomcat-8.5.6/webapps/ROOT/WEB-INF/lib/logback-classic-1.1.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/apache-tomcat-8.5 .6/webapps/ROOT/WEB-INF/lib/slf4j-log4j12-1.7.21.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Logback的網站上說,這是警告,即使有多個,那也會預設選擇一個實現用,所以不會影響最終的Log功能。