PlayFramwork 1.x的测试中的日志级别 [英] Log level in tests for PlayFramwork 1.x
问题描述
当我在控制台中的localhost:9000/@ tests#中启动测试时,我可以看到带有DEBUG日志级别的长日志.我想摆脱它.我试图放入我的application.conf
When I launch my tests in localhost:9000/@tests# in console I can see long-long log with DEBUG log-level. I want to get rid of that. I tried to put to my application.conf
像这样的行
application.log=INFO
甚至是这一行:
application.log.system.out=off
但是它不起作用.也许我应该以某种方式专门为测试上下文设置log4j设置.
But it does not work. Maybe I should put log4j setting specially for test context somehow..?
推荐答案
您可以简单地在这两个规则的前面加上"test" ID.
You can simply prefix those two rules with the "test" id.
%test.application.log.system=off
%test.application.log=ERROR
顺便说一下,日志级别为:trace
-> debug
-> info
-> warn
-> error
-> fatal
And by the way log levels are : trace
-> debug
-> info
-> warn
-> error
-> fatal
因此,在显示info
时,您将显示很多信息.
So when displaying info
, you are displaying a lot of information.
这篇关于PlayFramwork 1.x的测试中的日志级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!