Created
August 14, 2019 22:40
-
-
Save stokito/a06b093d9798f125d7a29eb1c2d26caf to your computer and use it in GitHub Desktop.
Get rid off Janino condition tags for the pattern and simplify it with variable reference The <if> tag requires the Janino library with full java compiler while we just need a simple pattern matching by env var. The solution is to declare two <property> constants with the pattern and then chose one of the constants as a pattern. If SINGLE_LINE_P…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<include resource="org/springframework/boot/logging/logback/defaults.xml"/> | |
<property scope="context" name="pattern.singleLine.true" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z', UTC} %5p %logger [%t] \(%X{trace}\) %X{loggingMessageExtender}: %replace(%m%n%ex){'\n(?=[^$])','\\n'}%nopex" /> | |
<property scope="context" name="pattern.singleLine.false" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z', UTC} -%5p %logger [%t] \(%X{trace}\) %X{loggingMessageExtender}: %m%n" /> | |
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | |
<encoder> | |
<Pattern>${pattern.singleLine.${SINGLE_LINE_PATTERN:-false}}"</Pattern> | |
</encoder> | |
</appender> | |
<root level="INFO"> | |
<appender-ref ref="CONSOLE"/> | |
</root> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment