![](/img/trans.png)
[英]PlayFramework 2.5: SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”
[英]Play/Scala 2.5 SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”
將Scala項目從Play Framwork 2.4升級到2.5后,出現以下錯誤:
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.
java.lang.NoSuchMethodError: play.api.Logger$.init(Ljava/io/File;Lscala/Enumeration$Value;)V
根據這些頁面:
https://www.playframework.com/documentation/2.5.x/Migration25#change-to-logback-configuration https://www.playframework.com/documentation/2.5.x/SettingsLogger
我已經更新了logback.xml
文件以使用play.api.libs.logback.ColoredLevel
。 該頁面顯示了如何使用其他日志記錄框架的示例,但是我希望繼續使用默認的日志記錄框架。 該文檔沒有說任何其他依賴項是必需的。
我缺少一些依賴嗎? 我需要做什么?
升級過程中缺少一個配置文件,請更新project / plugins.sbt中的Play版本號以升級Play:
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.x")
參見https://www.playframework.com/documentation/2.5.x/Migration25
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.