Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

in play 2.4 logback configurations, where is ${application.home} defined?

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.

like image 352
Roy Lin Avatar asked Jul 17 '15 23:07

Roy Lin


3 Answers

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 ...
}
like image 171
Yevgeniy Brikman Avatar answered Oct 08 '22 08:10

Yevgeniy Brikman


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

like image 22
Roy Lin Avatar answered Oct 08 '22 08:10

Roy Lin


appliation.home is defined by play framework itself.

https://github.com/playframework/playframework/blob/2.4.x/framework/src/play/src/main/scala/play/api/Logger.scala#L199

You must have another problem.

like image 28
bigwheel Avatar answered Oct 08 '22 09:10

bigwheel