JsonPath ignore the Debug logs on output
This question was actually asked on 2017 on their official github page.
Looks like you need to use a logback as the log implementation
here is the code provided by andreasaronsson from the github issue
LoggerContext logContext = (LoggerContext) LoggerFactory.getILoggerFactory();ch.qos.logback.classic.Logger log = logContext.getLogger("com.jayway.jsonpath.internal.path.CompiledPath");log.setLevel(Level.INFO);
You need this in your dependencies
<dependencies> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>2.11.1</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.11.1</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.2.3</version> </dependency></dependencies>
For more closure about the issue you can find it here
What logging framework are you using? Just set the level of com.jayway.jsonpath
logger to INFO or higher. Below are examples of doing that with XML config for Logback and Log4j 2.
Logback:
<configuration> … <logger name="com.jayway.jsonpath" level="INFO"/> <root level="DEBUG"> <appender-ref ref="STDOUT" /> </root> </configuration>
Log4j 2:
<Configuration status="WARN"> … <Loggers> <Logger name="com.jayway.jsonpath" level="info"> <AppenderRef ref="STDOUT"/> </Logger> <Root level="debug"> <AppenderRef ref="STDOUT"/> </Root> </Loggers></Configuration>