【问题标题】:Play/Scala 2.5 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"Play/Scala 2.5 SLF4J:无法加载类“org.slf4j.impl.StaticLoggerBinder”
【发布时间】:2016-04-25 15:30:08
【问题描述】:

将 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。该页面显示了如何使用其他日志框架的示例,但我希望继续使用默认的 logback 框架。文档没有说需要任何额外的依赖项。

我是否缺少一些依赖项?我需要做什么?

【问题讨论】:

    标签: scala playframework logback


    【解决方案1】:

    升级过程中遗漏了一个配置文件,更新project/plugins.sbt中的Play版本号来升级Play:

    addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.x")
    

    见https://www.playframework.com/documentation/2.5.x/Migration25

    【讨论】:

      猜你喜欢
      • 2016-10-04
      • 2011-11-17
      • 1970-01-01
      • 2012-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多