Browse Source

Make it easier to override CONSOLE_LOG_PATTERN when including base.xml

Previously, the CONSOLE_LOG_PATTERN property would always be set as
a result of base.xml including defaults.xml. This made it hard to
override the CONSOLE_LOG_PATTERN as it required a copy and paste of
the configuration.

This commit updates defaults.xml so that CONSOLE_LOG_PATTERN is only
set if it has not already been set. This reduces the configuration to
customize the console log pattern to a handful of lines.

Closes gh-5632
Closes gh-5867
pull/5733/merge
boriswaguia 10 years ago committed by Andy Wilkinson
parent
commit
7f7a109acb
  1. 3
      spring-boot/src/main/resources/org/springframework/boot/logging/logback/defaults.xml

3
spring-boot/src/main/resources/org/springframework/boot/logging/logback/defaults.xml

@ -9,8 +9,7 @@ initialization performed by Boot @@ -9,8 +9,7 @@ initialization performed by Boot
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<property name="CONSOLE_LOG_PATTERN" value="%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<property name="FILE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
<appender name="DEBUG_LEVEL_REMAPPER" class="org.springframework.boot.logging.logback.LevelRemappingAppender">

Loading…
Cancel
Save