Refactor the 'spring-geode-starter-logging' module provided logback.xml file to use templates (includes).

Moved the declared Appenders and Loggers from logback.xml to a new logback-include.xml file making it easier to compose Logback (XML) configuration files using templates, or includes.  This is particularly useful during Integration Testing where logback-test.xml files can be composed with different templates/includes.

Resolves gh-73.
This commit is contained in:
John Blum
2020-02-07 17:02:57 -08:00
parent 269b60bdc6
commit 85d630c34e
2 changed files with 18 additions and 9 deletions

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<included>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %5p %40.40c:%4L - %m%n</pattern>
</encoder>
</appender>
<appender name="delegate" class="org.springframework.geode.logging.slf4j.logback.DelegatingAppender"/>
<logger name="com.gemstone.gemfire" level="${spring.boot.data.gemfire.log.level:-INFO}"/>
<logger name="org.apache.geode" level="${spring.boot.data.gemfire.log.level:-INFO}"/>
<logger name="org.jgroups" level="${spring.boot.data.gemfire.jgroups.log.level:-ERROR}"/>
</included>

View File

@@ -3,18 +3,11 @@
<statusListener class="ch.qos.logback.core.status.NopStatusListener"/>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %5p %40.40c:%4L - %m%n</pattern>
</encoder>
</appender>
<logger name="com.gemstone.gemfire" level="${spring.boot.data.gemfire.log.level:-INFO}" additivity="false"/>
<logger name="org.apache.geode" level="${spring.boot.data.gemfire.log.level:-INFO}" additivity="false"/>
<logger name="org.jgroups" level="${spring.boot.data.gemfire.jgroups.log.level:-ERROR}" additivity="false"/>
<include resource="logback-include.xml"/>
<root level="${logback.root.log.level:-ERROR}">
<appender-ref ref="console"/>
<appender-ref ref="delegate"/>
</root>
</configuration>