I've got a pair of custom loggers defined for LogBack in a Spring Boot application. The idea is to send all of that logging to a file, instead of the standard console output provided by Spring Boot by default. What I'm seeing is that the logging goes to both the custom file AND the console, and I cannot find any reason for that to happen. All logging to the two custom appenders is at DEBUG and/or TRACE level. I have set logging.level.root=INFO, thinking that would prevent this logging from showing up, but that didn't help.
I do have the standard Spring Boot logging configured for use in the application. So logging.path and logging.file are both set.
Any help appreciated.
Here is my custom logback-spring.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!--
LogBack configuration used by all services to create separate files for TRACE and SOAP logs.
-->
<configuration>
<!-- Include the basic Spring-Boot logback configuration. -->
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<!-- An appender and logger for TRACE logging of method calls -->
<appender name="TraceLoggingAppender" class="ch.qos.logback.core.FileAppender">
<file>${LOG_PATH}/logs/trace.log</file>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<logger name="TraceLogging" additivity="false" level="trace">
<appender-ref ref="TraceLoggingAppender"/>
</logger>
<!-- An appender and logger for SOAP envelope logging -->
<appender name="SoapLoggingAppender" class="ch.qos.logback.core.FileAppender">
<file>${LOG_PATH}/logs/soap.log</file>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<logger name="SoapLogging" additivity="false" level="debug">
<appender-ref ref="SoapLoggingAppender"/>
</logger>
</configuration>
And an example usage:
private static final Log LOG = LogFactory.getLog("SoapLogging");
...
LOG.debug(soapMessage);