From f6a6f8f3e2ba41b44c2e9490b9dc2cc013fa2994 Mon Sep 17 00:00:00 2001 From: Titouan BION Date: Sat, 13 Feb 2021 23:25:18 +0100 Subject: Add Loki logback appender to push server logs to the free cloud hosted Loki instance provided by Grafana.com --- sw-server/build.gradle.kts | 3 ++- sw-server/src/main/resources/logback.xml | 38 ++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 sw-server/src/main/resources/logback.xml (limited to 'sw-server') diff --git a/sw-server/build.gradle.kts b/sw-server/build.gradle.kts index a129f952..445ae4d8 100644 --- a/sw-server/build.gradle.kts +++ b/sw-server/build.gradle.kts @@ -24,7 +24,8 @@ dependencies { implementation("org.springframework.security:spring-security-messaging") // logging - implementation("ch.qos.logback:logback-classic:1.1.8") + implementation("ch.qos.logback:logback-classic:1.2.3") + implementation("com.github.loki4j:loki-logback-appender:1.0.0") // monitoring / metrics implementation("org.springframework.boot:spring-boot-starter-actuator") diff --git a/sw-server/src/main/resources/logback.xml b/sw-server/src/main/resources/logback.xml new file mode 100644 index 00000000..c87e740c --- /dev/null +++ b/sw-server/src/main/resources/logback.xml @@ -0,0 +1,38 @@ + + + + + + + 1 + 10000 + + https://logs-prod-us-central1.grafana.net/loki/api/v1/push + + ${LOKI_USERNAME} + ${LOKI_PASSWORD} + + 15000 + + + + + level=%level class=%logger thread=%thread | %msg %ex + + + + + + + + + + + + -- cgit