Maven surefire下的日志记录级别 [英] Logging level under maven surefire
问题描述
我无法调整Java日志记录的日志记录级别.我正在使用Maven surefire(MVN测试),并尝试从默认INFO调整为例如最好.
I'm unable to adjust java logging's logging level. I'm using maven surefire (mvn test), and trying to adjust from the default INFO to e.g. FINEST.
我在 src/test/resources/logging.properties
编译后,我看到在目标/测试类下,我看到了具有预期配置的logging.properties文件:
after compile, i see under target/test-classes, i see a logging.properties file with the intended config:
java.util.logging.ConsoleHandler.level = FINEST
javax.enterprise.system.container.ejb.level = FINE
...
但是,glassfish的控制台输出仅包含INFO/SEVERE级消息.
however the console output from glassfish only have INFO / SEVERE level messages.
我哪里出错了?还是这是与Maven对接的另一种痛苦?
Where did I go wrong? or is this another pain in the butt thing with maven?
推荐答案
您需要在日志文件中指定处理程序
You need to specifiy your handlers in the logging file
handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler
然后它应该工作
这篇关于Maven surefire下的日志记录级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!