播放Framework 2.2日志输出到测试中的控制台 [英] Play Framework 2.2 log output to console in tests
问题描述
如何在Play Framework 2.2中配置记录器,以便在播放集成测试期间在控制台中看到日志输出?
How do I configure the logger in Play Framework 2.2 in order that I see log output in the console during play integration tests?
Play Framework 2.1的配置不再起作用.
The configuration for Play Framework 2.1 does not work anymore.
BR Rene
推荐答案
我还没有这样做,但是您必须配置一个logback配置文件.有关其他信息,请参见播放文档: http://www.playframework.com/documentation/2.2 .x/SettingsLogger
I have not done this yet, but you have to configure a logback configuration file. See the play documentation for additional information: http://www.playframework.com/documentation/2.2.x/SettingsLogger
一旦定义了特定的logback配置文件,则需要将该文件放置在测试包中,有关详细信息,请参见此问题:
Once you defined a specific logback configuration file, this needs to be placed in the test package, see this issue for details:https://github.com/playframework/playframework/issues/1669#issuecomment-24452132
请参阅来自 @benmccann 的消息:您可以通过将logback-test.xml放在测试/资源中来配置记录器处于测试模式(花了我几个小时来弄清楚!). /em>
See message from @benmccann: you can configure the logger in test mode by placing a logback-test.xml in test/resources (took me hours to figure out!).
这篇关于播放Framework 2.2日志输出到测试中的控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!