I'm trying to set up basic logging with logback.xml
with the scala-g8 template. The issue I'm having is that for some reason Play framework keeps using the logback file in the .ivy2
cache folder. I have a logback.xml
in my conf
directory, but it doesn't seem to be picking it up. Any ideas? Here's the log:
14:36:06,949 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback-test.xml] at [jar:file:/home/julian/.ivy2/cache/com.typesafe.play/play-openid_2.12/jars/play-openid_2.12-2.6.5.jar!/logback-test.xml]
14:36:06,961 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@4aeb1d4e - URL [jar:file:/home/julian/.ivy2/cache/com.typesafe.play/play-openid_2.12/jars/play-openid_2.12-2.6.5.jar!/logback-test.xml] is not of type file
14:36:07,060 |-INFO in ch.qos.logback.core.joran.action.StatusListenerAction - Added status listener of type [ch.qos.logback.core.status.NopStatusListener]
14:36:07,061 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
14:36:07,068 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
14:36:07,073 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
14:36:07,094 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to WARN
14:36:07,094 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
14:36:07,095 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
14:36:07,095 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@6d63c1fd - Registering current configuration as safe fallback point
14:36:06,949 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback-test.xml] at [jar:file:/home/julian/.ivy2/cache/com.typesafe.play/play-openid_2.12/jars/play-openid_2.12-2.6.5.jar!/logback-test.xml]
14:36:06,961 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@4aeb1d4e - URL [jar:file:/home/julian/.ivy2/cache/com.typesafe.play/play-openid_2.12/jars/play-openid_2.12-2.6.5.jar!/logback-test.xml] is not of type file
14:36:07,060 |-INFO in ch.qos.logback.core.joran.action.StatusListenerAction - Added status listener of type [ch.qos.logback.core.status.NopStatusListener]
14:36:07,061 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
14:36:07,068 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
14:36:07,073 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
14:36:07,094 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to WARN
14:36:07,094 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
14:36:07,095 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
14:36:07,095 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@6d63c1fd - Registering current configuration as safe fallback point
14:36:07,167 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@77ece54e - URL [jar:file:/home/julian/.ivy2/cache/com.typesafe.play/play-openid_2.12/jars/play-openid_2.12-2.6.5.jar!/logback-test.xml] is not of type file
14:36:07,169 |-INFO in ch.qos.logback.core.joran.action.StatusListenerAction - Added status listener of type [ch.qos.logback.core.status.NopStatusListener]
14:36:07,169 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
14:36:07,169 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
14:36:07,169 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
14:36:07,169 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to WARN
14:36:07,169 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
14:36:07,170 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
14:36:07,170 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@5aaa6c89 - Registering current configuration as safe fallback point
It's really odd since this is the right-out-of-the-box template. Thanks!
I am pretty sure they broke conf/logback.xml in 2.6.13 in this update. If you are using that version, try going back to 2.6.12 and I suspect everything will work like you expect.
UPDATE: I believe the latest version 2.6.15 has a fix to this now.