Jak wskazano przez @ user316607, Play powinien sam zdefiniować application.home
w Logger.configure method. Jeśli widzisz wartość application.home_IS_UNDEFINED
zamiast, i używasz compile-time dependency injection, musisz zadzwonić Logger.configure
się w swoim ApplicationLoader
jak wyjaśniono w this blog post:
class MyApplicationLoader extends ApplicationLoader {
def load(context: Context) = {
new MyComponents(context).application
}
}
class MyComponents(context: Context) extends BuiltInComponentsFromContext(context) {
// You have to call Logger.configure manually or logback won't work
Logger.configure(context.environment)
// ... The rest of your app initialization code ...
}
Dla kompilacji DI w Play 2.5, Logger.configure został przeniesiony do [LoggerConfigurator] (https://www.playframework.com/documentation/2.5.x/api/scala/index.html#play.api.LoggerConfigurator) , oprócz innych [zmian] (https://github.com/playframework/playframework/commit/0a01f5babc1022023dd6466a83d0769331ae87c8). Przykład konfiguracji Loggera jest pokazany w liniach 60-67 [tutaj] (https://github.com/playframework/playframework/blob/0a01f5babc1022023dd6466a83d0769331ae87c8/documentation/manual/working/scalaGuide/advanced/dependencyinjection/code/CompileTimeDependencyInjection.scala). –