playframework/playframework — pull request #1186 by jroper (2014-08-07 07:09:30+00:00)
Title: [2.1] Logging levels configuration in application.conf is ignored in production mode (dist)

The following login configuration in application.conf works in DEV mode but not in a DIST. release:

```bash
logger.root=DEBUG
logger.play=DEBUG
logger.application=DEBUG
```

These loggin levers are loaded into logback in the Application.scala class

```scala
Logger.configure(
Map("application.home" -> path.getAbsolutePath),
configuration.getConfig("logger").map { loggerConfig =>
loggerConfig.keys.map {
case "resource" | "file" | "url" => "" -> null
case key @ "root" => "ROOT" -> loggerConfig.getString(key, Some(validValues)).map(setLevel).get
case key => key -> loggerConfig.getString(key, Some(validValues)).map(setLevel).get
}.toMap
}.getOrElse(Map.empty),
mode)
```

However this configuration gets replaced by this other code in the Server trait when running in DIST. mode:

```scala
// Configure the logger for the first time
Logger.configure(
Map("application.home" -> applicationProvider.path.getAbsolutePath),
mode = mode)
```

The logger is reset and all config is lost.

As I understand it, the Server trait constructor should be loaded before Application.scala, but it seems it is the other way around.