Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <configuration>
- <!-- standard logging with spring profile "dev"-->
- <springProfile name="dev">
- <include resource="org/springframework/boot/logging/logback/base.xml"/>
- <appender name="CONSOLE-MDC" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <!-- pattern copied from org/springframework/boot/logging/logback/default.xml, adding {%mdc}
- after message -->
- <pattern>%clr(%d{${LOG_DATEFORMAT_PATTERN:-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 {%mdc}%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}</pattern>
- <charset>${CONSOLE_LOG_CHARSET}</charset>
- </encoder>
- </appender>
- <logger name="mypackage" level="INFO" additivity="false">
- <appender-ref ref="CONSOLE-MDC"/>
- </logger>
- </springProfile>
- <!-- json logging without spring profile "dev"-->
- <springProfile name="!dev">
- <appender name="jsonConsoleAppender" class="ch.qos.logback.core.ConsoleAppender">
- <encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
- </appender>
- <root level="INFO">
- <appender-ref ref="jsonConsoleAppender"/>
- </root>
- </springProfile>
- </configuration>
Add Comment
Please, Sign In to add comment