1
I’m trying to deal with the logging level of a dependency, where it’s showing INFO and I would not like her to show that level, because the information is not pertinent, in my case is the logging level of Junit 5.
Follow the dependency logging result when I run my code:
Sep 19, 2019 12:17:47 AM org.junit.platform.launcher.core.LauncherConfigurationParameters fromClasspathResource
INFO: Loading JUnit Platform configuration parameters from classpath resource [file:/E:/root/scalableapitesting/target/classes/junit-platform.properties].
Sum result is : 10
Subtraction result is : 5
Sep 19, 2019 12:17:47 AM org.junit.jupiter.engine.config.EnumConfigurationParameterConverter get
INFO: Using parallel execution mode 'SAME_THREAD' set via the 'junit.jupiter.execution.parallel.mode.default' configuration parameter.
Sep 19, 2019 12:17:47 AM org.junit.jupiter.engine.config.EnumConfigurationParameterConverter get
INFO: Using parallel execution mode 'CONCURRENT' set via the 'junit.jupiter.execution.parallel.mode.classes.default' configuration parameter.
Process finished with exit code 0
Every part of INFO, I would like to remove.
By searching, the logging api that Junit 5 uses:
Junit uses the Java Logging Apis in the java.util.logging package (a.k.a. JUL) to Emit warnings and debug information. Please refer to the Official Documentation of Logmanager for Configuration options.
I saw things about the logging.properties
, log4j.properties
but I still could not change the level, I believe that some configuration file will be possible to modify it.
Dependence on pom.xml
that this generating the logging:
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.5.2</version>
</dependency>
You can regulate the log level by packages, for example setting the level for the package
org.junit.platform
asINFO
. Lamppostlog4j.properties
orlogging.properties
orslf4j
...– nullptr
Well, after more research, I discovered that when using JUL, if you want to point to a different logging.properties, besides creating the Voce file you should point to the java.
– Spencer Melo