ILyaCyclone

Untitled

Oct 6th, 2021 (edited)
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.26 KB | None | 0 0
  1. <configuration>
  2.   <!--  standard logging with spring profile "dev"-->
  3.   <springProfile name="dev">
  4.     <include resource="org/springframework/boot/logging/logback/base.xml"/>
  5.     <appender name="CONSOLE-MDC" class="ch.qos.logback.core.ConsoleAppender">
  6.       <encoder>
  7.         <!-- pattern copied from org/springframework/boot/logging/logback/default.xml, adding {%mdc}
  8. after message -->
  9.         <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>
  10.         <charset>${CONSOLE_LOG_CHARSET}</charset>
  11.       </encoder>
  12.     </appender>
  13.     <logger name="mypackage" level="INFO" additivity="false">
  14.       <appender-ref ref="CONSOLE-MDC"/>
  15.     </logger>
  16.   </springProfile>
  17.  
  18.   <!--  json logging without spring profile "dev"-->
  19.   <springProfile name="!dev">
  20.     <appender name="jsonConsoleAppender" class="ch.qos.logback.core.ConsoleAppender">
  21.       <encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
  22.     </appender>
  23.     <root level="INFO">
  24.       <appender-ref ref="jsonConsoleAppender"/>
  25.     </root>
  26.   </springProfile>
  27. </configuration>
Add Comment
Please, Sign In to add comment