Can't turn off HtmlUnit logging messages

后端 未结 7 2040
悲哀的现实
悲哀的现实 2020-12-28 08:50

I\'m using HtmlUnit to interact with a web page that interacts with the server via Ajax. Soon after the Ajax code starts, HtmlUnit produces these two log messages:

相关标签:
7条回答
  • 2020-12-28 09:20

    If using Spring, spring uses LogBack by default so you can create a logback.xml or logback-test.xml in 'main/resources/' or 'test/resources' folder.

    You can set log level by package like this:

    <configuration>
        <include resource="/org/springframework/boot/logging/logback/base.xml"/>
        <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
            <encoder>
                <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
                </pattern>
            </encoder>
        </appender>
        <root level="error">
            <appender-ref ref="STDOUT"/>
        </root>
        <logger name="com.mypackage" level="debug"/>
        <logger name="com.gargoylesoftware" level="error"/>
    </configuration>
    
    0 讨论(0)
提交回复
热议问题