Logback Play Framework 2.6使用不正确的配置文件

时间:2018-04-10 18:42:36

标签: scala playframework logback

我正在尝试使用scala-g8模板使用logback.xml设置基本日志记录。我遇到的问题是由于某种原因Play框架继续使用.ivy2缓存文件夹中的logback文件。我的logback.xml目录中有一个conf,但它似乎没有提起它。有任何想法吗?这是日志:

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

这真是奇怪,因为这是一个开箱即用的模板。谢谢!

1 个答案:

答案 0 :(得分:1)

我很确定他们在这个update中破坏了2.6.13中的conf / logback.xml。如果您使用的是该版本,请尝试返回2.6.12,我怀疑一切都会按预期运行。

更新:我相信最新版本2.6.15现在已经解决了这个问题。