From 1acedad0abe29200258fa3762db8cc2ee0214311 Mon Sep 17 00:00:00 2001 From: Fabian Engelniederhammer Date: Thu, 4 Apr 2024 13:35:03 +0200 Subject: [PATCH] feat: log to files again (additionally to stdout) #692 --- lapis2/README.md | 5 +++ .../genspectrum/lapis/LapisSpringConfig.kt | 3 -- lapis2/src/main/resources/logback.xml | 39 ++++++++++++++++--- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/lapis2/README.md b/lapis2/README.md index 8502e06d..ffb859ac 100644 --- a/lapis2/README.md +++ b/lapis2/README.md @@ -57,3 +57,8 @@ How to execute the tests * Install NPM dependencies: `npm install` * Generate a Typescript client for LAPIS: `npm run generateLapisClient` * Execute the tests: `npm run test` + +## Logs + +LAPIS logs to rotating files in `./logs` and to stdout. +In the Docker container, log files are stored in `/workspace/logs` diff --git a/lapis2/src/main/kotlin/org/genspectrum/lapis/LapisSpringConfig.kt b/lapis2/src/main/kotlin/org/genspectrum/lapis/LapisSpringConfig.kt index 11e6c8a2..a3554a6a 100644 --- a/lapis2/src/main/kotlin/org/genspectrum/lapis/LapisSpringConfig.kt +++ b/lapis2/src/main/kotlin/org/genspectrum/lapis/LapisSpringConfig.kt @@ -71,9 +71,6 @@ class LapisSpringConfig { @Bean fun logFilter(): CommonsRequestLoggingFilter { val filter = CommonsRequestLoggingFilter() - filter.setIncludeQueryString(true) - filter.setIncludePayload(true) - filter.setMaxPayloadLength(10000) filter.setIncludeHeaders(false) return filter } diff --git a/lapis2/src/main/resources/logback.xml b/lapis2/src/main/resources/logback.xml index da11f4ae..c46cc6db 100644 --- a/lapis2/src/main/resources/logback.xml +++ b/lapis2/src/main/resources/logback.xml @@ -1,6 +1,35 @@ - + + + + + + + ${LOG_DIR}/${LOG_FILE}.log + + ${PATTERN} + + + + ${LOG_DIR}/archived/${LOG_FILE}-%d{yyyy-MM-dd}.%i.gz + 10GB + 0 + + + + + ${LOG_DIR}/${STATISTICS_LOG_FILE}.log + + %message%n + + + + ${LOG_DIR}/archived/${STATISTICS_LOG_FILE}-%d{yyyy-MM-dd}.%i.gz + 10GB + 0 + + @@ -10,17 +39,17 @@ + - - - - + + +