The link here shows you how to configure your custom logger.
https://www.playframework.com/documentation/2.4.x/SettingsLogger
I was just wondering where is the ${applicaation.home} defined, as it seems to not have been defined in my production environment.
As indicated by @user316607, Play should define application.home
by itself in the Logger.configure method. If you are seeing the value application.home_IS_UNDEFINED
instead, and you're using compile-time dependency injection, you'll need to call Logger.configure
yourself in your ApplicationLoader
as explained in 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 ...
}
I feel stupid. I just realised that it's part of logback and not part of play. You can define your own variables like thus:
<property name="USER_HOME" value="/home/sebastien" />
Checkout link here for more details: http://logback.qos.ch/manual/configuration.html#definingProps
appliation.home is defined by play framework itself.
You must have another problem.
来源:https://stackoverflow.com/questions/31486216/in-play-2-4-logback-configurations-where-is-application-home-defined