feo*_*eob 9 logging junit intellij-idea spring-boot log-level
I have a problem with test console output in IntelliJ 2016. When I run JUnit tests via IntelliJ, the console window is flooded with enormous amounts of log lines, for example
DEBUG reactor.ipc ....
DEBUG io.netty.buffer.ByteBufUtil ....
Run Code Online (Sandbox Code Playgroud)
It's a simple Spring-Boot application which uses the default logging - I think it's slf4j. I tried setting
logging.level.reactor.ipc=WARN
Run Code Online (Sandbox Code Playgroud)
in my src/main/resources/application.properties and also setting
-Dlogging.level.root=WARN on the RunConfig's VM arguments, but neither has any effect on the log output.
What is the correct place to configure logging verbosity when executing Tests from Intellij?
小智 8
您可以使用示例内容填充 src/test/resources 中名为 logback.xml 的文件,例如:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %5p | %t | %-55logger{55} | %m %n</pattern>
</encoder>
</appender>
<root>
<level value="TRACE"/>
<appender-ref ref="CONSOLE"/>
</root>
</configuration>
Run Code Online (Sandbox Code Playgroud)
具有 TRACE 日志记录级别。您可以更改此日志级别以满足您的需要。
| 归档时间: |
|
| 查看次数: |
7487 次 |
| 最近记录: |