From 5e3ab4bc9440aa2ef4e02c648ab23c4c4d1faf65 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Thu, 9 Apr 2020 21:28:59 +0800 Subject: [PATCH] locally sourced, organic log config --- docs/src/main/asciidoc/features.adoc | 4 +- docs/src/main/asciidoc/logback-spring.xml | 72 +++++++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 docs/src/main/asciidoc/logback-spring.xml diff --git a/docs/src/main/asciidoc/features.adoc b/docs/src/main/asciidoc/features.adoc index fd7b21ad3..77f7ef037 100644 --- a/docs/src/main/asciidoc/features.adoc +++ b/docs/src/main/asciidoc/features.adoc @@ -97,11 +97,11 @@ To do so, you have to do the following (for readability, we pass the dependencie *Logback Setup* -Consider the following example of a Logback configuration file (named https://github.com/spring-cloud-samples/sleuth-documentation-apps/blob/master/service1/src/main/resources/logback-spring.xml[logback-spring.xml]). +Consider the following example of a Logback configuration file (named https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/{branch}/docs/src/main/asciidoc/logback-spring.xml[logback-spring.xml]). [source,xml] ----- -include::https://raw.githubusercontent.com/spring-cloud-samples/sleuth-documentation-apps/master/service1/src/main/resources/logback-spring.xml[] +include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/{branch}/docs/src/main/asciidoc/logback-spring.xml[] ----- That Logback configuration file: diff --git a/docs/src/main/asciidoc/logback-spring.xml b/docs/src/main/asciidoc/logback-spring.xml new file mode 100644 index 000000000..fb02a5e8b --- /dev/null +++ b/docs/src/main/asciidoc/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" + } + + + + + + + + + + + +