<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
-
<springProperty scope="context" name="springAppName" source="spring.application.name"/>
<!-- Example for logging into the build folder of your project -->
- <property name="LOG_FILE" value="${BUILD_FOLDER:-build}/${springAppName}"/>
+ <property name="LOG_FILE" value="${BUILD_FOLDER:-build}/${springAppName}"/>
<!-- You can override this to have a custom pattern -->
<property name="CONSOLE_LOG_PATTERN"
@@ -423,7 +422,7 @@ To do so, you have to do the following (for readability, we pass the dependencie
</encoder>
</appender>
- <!-- Appender to log to file -->
+ <!-- Appender to log to file -->
<appender name="flatfile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_FILE}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
@@ -435,7 +434,6 @@ To do so, you have to do the following (for readability, we pass the dependencie
<charset>utf8</charset>
</encoder>
</appender>
-
<!-- Appender to log to file in a JSON format -->
<appender name="logstash" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_FILE}.json</file>
@@ -451,13 +449,11 @@ To do so, you have to do the following (for readability, we pass the dependencie
<pattern>
<pattern>
{
+ "timestamp": "@timestamp",
"severity": "%level",
"service": "${springAppName:-}",
- "trace": "%X{X-B3-TraceId:-}",
- "span": "%X{X-B3-SpanId:-}",
- "parent": "%X{X-B3-ParentSpanId:-}",
- "exportable": "%X{X-Span-Export:-}",
- "baggage": "%X{key:-}",
+ "trace": "%X{traceId:-}",
+ "span": "%X{spanId:-}",
"pid": "${PID:-}",
"thread": "%thread",
"class": "%logger{40}",
@@ -468,7 +464,6 @@ To do so, you have to do the following (for readability, we pass the dependencie
</providers>
</encoder>
</appender>
-
<root level="INFO">
<appender-ref ref="console"/>
<!-- uncomment this to have also JSON logs -->
diff --git a/reference/html/logback-spring.xml b/reference/html/logback-spring.xml
new file mode 100644
index 000000000..fb02a5e8b
--- /dev/null
+++ b/reference/html/logback-spring.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DEBUG
+
+
+ ${CONSOLE_LOG_PATTERN}
+ utf8
+
+
+
+
+
+ ${LOG_FILE}
+
+ ${LOG_FILE}.%d{yyyy-MM-dd}.gz
+ 7
+
+
+ ${CONSOLE_LOG_PATTERN}
+ utf8
+
+
+
+
+ ${LOG_FILE}.json
+
+ ${LOG_FILE}.json.%d{yyyy-MM-dd}.gz
+ 7
+
+
+
+
+ UTC
+
+
+
+ {
+ "timestamp": "@timestamp",
+ "severity": "%level",
+ "service": "${springAppName:-}",
+ "trace": "%X{traceId:-}",
+ "span": "%X{spanId:-}",
+ "pid": "${PID:-}",
+ "thread": "%thread",
+ "class": "%logger{40}",
+ "rest": "%message"
+ }
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/html/spring-cloud-sleuth.html b/reference/html/spring-cloud-sleuth.html
index 7733a48c5..f7eb370d9 100644
--- a/reference/html/spring-cloud-sleuth.html
+++ b/reference/html/spring-cloud-sleuth.html
@@ -395,17 +395,16 @@ To do so, you have to do the following (for readability, we pass the dependencie
Logback Setup
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
-
<springProperty scope="context" name="springAppName" source="spring.application.name"/>
<!-- Example for logging into the build folder of your project -->
- <property name="LOG_FILE" value="${BUILD_FOLDER:-build}/${springAppName}"/>
+ <property name="LOG_FILE" value="${BUILD_FOLDER:-build}/${springAppName}"/>
<!-- You can override this to have a custom pattern -->
<property name="CONSOLE_LOG_PATTERN"
@@ -423,7 +422,7 @@ To do so, you have to do the following (for readability, we pass the dependencie
</encoder>
</appender>
- <!-- Appender to log to file -->
+ <!-- Appender to log to file -->
<appender name="flatfile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_FILE}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
@@ -435,7 +434,6 @@ To do so, you have to do the following (for readability, we pass the dependencie
<charset>utf8</charset>
</encoder>
</appender>
-
<!-- Appender to log to file in a JSON format -->
<appender name="logstash" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_FILE}.json</file>
@@ -451,13 +449,11 @@ To do so, you have to do the following (for readability, we pass the dependencie
<pattern>
<pattern>
{
+ "timestamp": "@timestamp",
"severity": "%level",
"service": "${springAppName:-}",
- "trace": "%X{X-B3-TraceId:-}",
- "span": "%X{X-B3-SpanId:-}",
- "parent": "%X{X-B3-ParentSpanId:-}",
- "exportable": "%X{X-Span-Export:-}",
- "baggage": "%X{key:-}",
+ "trace": "%X{traceId:-}",
+ "span": "%X{spanId:-}",
"pid": "${PID:-}",
"thread": "%thread",
"class": "%logger{40}",
@@ -468,7 +464,6 @@ To do so, you have to do the following (for readability, we pass the dependencie
</providers>
</encoder>
</appender>
-
<root level="INFO">
<appender-ref ref="console"/>
<!-- uncomment this to have also JSON logs -->
diff --git a/reference/htmlsingle/logback-spring.xml b/reference/htmlsingle/logback-spring.xml
new file mode 100644
index 000000000..fb02a5e8b
--- /dev/null
+++ b/reference/htmlsingle/logback-spring.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DEBUG
+
+
+ ${CONSOLE_LOG_PATTERN}
+ utf8
+
+
+
+
+
+ ${LOG_FILE}
+
+ ${LOG_FILE}.%d{yyyy-MM-dd}.gz
+ 7
+
+
+ ${CONSOLE_LOG_PATTERN}
+ utf8
+
+
+
+
+ ${LOG_FILE}.json
+
+ ${LOG_FILE}.json.%d{yyyy-MM-dd}.gz
+ 7
+
+
+
+
+ UTC
+
+
+
+ {
+ "timestamp": "@timestamp",
+ "severity": "%level",
+ "service": "${springAppName:-}",
+ "trace": "%X{traceId:-}",
+ "span": "%X{spanId:-}",
+ "pid": "${PID:-}",
+ "thread": "%thread",
+ "class": "%logger{40}",
+ "rest": "%message"
+ }
+
+
+
+
+
+
+
+
+
+
+
+