New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix LogbackLoggerConfigurator#init #8378
Conversation
@@ -63,6 +66,7 @@ class LogbackLoggerConfigurator extends LoggerConfigurator { | |||
|
|||
val properties = LoggerConfigurator.generateProperties(env, configuration, optionalProperties) | |||
|
|||
play.api.Logger.setApplicationMode(env.mode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually fixes a separate bug. The mode should be set in configure
not init
since init
is only called by the dev mode server and not the application itself.
9bfb8e6
to
9dc8168
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
ps.: I wonder if is possible to have a test for this.
I changed this in #8275 without realizing this was only used in initializing the dev mode server before an application is available, and is intentionally more minimal for that reason. This change should be minimal risk, since it reverts to the previous behavior in 2.6.12.
This also fixes another issue, which is that the global logging mode (used for
logger.forMode
) should be set inconfigure
.