-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seeing DEBUG level logs after adding logcaptor dependency #47
Comments
Do you mean that you are seeing these debug logs within your build output when running the tests? |
We have resolved this issue together with the pull request for the exposed library here: JetBrains/Exposed#1852 The issue is not a bug but related to the underlying engine of LogCaptor which is outside of the control of LogCaptor itself. It is using Logback as SLF4J binding/implementation and Logback is using his own kind of logging configuration. So the log4j2.xml logger configuration is being ignored during the test resulting in showing also debug logs while previously disabled. Solution is to add a logback-test.xml file in the test resources which is similar to the log4j2.xml configuration file. The file content of the logback-test.xml file is: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%date{HH:mm:ss.SSS} %level %thread %logger{0}:%method:%line - %message %n</pattern>
</encoder>
</appender>
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="CONSOLE"/>
<includeCallerData>true</includeCallerData>
</appender>
<root level="INFO">
<appender-ref ref="ASYNC" />
</root>
<logger name="Exposed" level="INFO" additivity="false">
<appender-ref ref="ASYNC"/>
</logger>
</configuration>
<!-- 19:57:29.845 DEBUG Test worker Exposed - DROP TABLE jointable --> Please note that the above configuration is written for a specific project, if copied you need to adjust the logger name ad maybe ad additional loggers to further configure your logs. I am closing this issue, thank you @joc-a I think this is valuable for anyone who wil encounter the same issue. |
Describe the bug
I started seeing DEBUG level logging after adding the logcaptor dependency.
logger.isDebugEnabled
is now returning true.To Reproduce
I'm using slf4j and this is the log4j2.xml file:
Expected behavior
How can I keep the same level of logging as before adding the dependency?
Screenshots
If applicable, add screenshots to help explain your problem.
Environmental Data:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: