File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
logback-ecs-encoder/src/main/resources/co/elastic/logging/logback/boot Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,10 @@ In `src/main/resources/logback-spring.xml`:
11
11
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
12
12
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
13
13
<include resource="org/springframework/boot/logging/logback/file-appender.xml" />
14
+ <include resource="co/elastic/logging/logback/boot/ecs-console-appender.xml" />
14
15
<include resource="co/elastic/logging/logback/boot/ecs-file-appender.xml" />
15
16
<root level="INFO">
17
+ <appender-ref ref="ECS_JSON_CONSOLE"/>
16
18
<appender-ref ref="CONSOLE"/>
17
19
<appender-ref ref="ECS_JSON_FILE"/>
18
20
<appender-ref ref="FILE"/>
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+
3
+ <!--
4
+ ECS JSON console appender logback configuration provided for import, similar to the console-appender.xml included in Spring Boot
5
+ <include resource="co/elastic/logging/logback/boot/ecs-console-appender.xml" />
6
+ -->
7
+
8
+ <included >
9
+ <springProperty name =" SERVICE_NAME" source =" spring.application.name" />
10
+ <appender name =" ECS_JSON_CONSOLE" class =" ch.qos.logback.core.ConsoleAppender" >
11
+ <encoder class =" co.elastic.logging.logback.EcsEncoder" >
12
+ <serviceName >${SERVICE_NAME:-spring-boot-application}</serviceName >
13
+ </encoder >
14
+ </appender >
15
+ </included >
You can’t perform that action at this time.
0 commit comments