我正在尝试在sbt项目中使用logback.xml。
我添加了以下依赖项:
"ch.qos.logback" % "logback-classic" % "1.2.3"
我创建了logback.xml并将其定位在:
/SRC/主要/资源
当我在intellij上运行它时,它有时工作,有时不工作。
当我运行jar(不是uber jar)时,它总是不起作用:
SLF4J: Found binding in [jar:file:/Users/***/.ivy2/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.7.16.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/***/.ivy2/cache/ch.qos.logback/logback-classic/jars/logback-classic-1.2.3.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 [org.slf4j.impl.Log4jLoggerFactory]
我认为这个问题与类路径问题有关,排除了slf4j,显式地指定了logback.xml路径,但是没有!
请帮忙!