From 64ec046cbf56cde47805aa8cdb41718d840ba65f Mon Sep 17 00:00:00 2001 From: tkuzynow Date: Wed, 3 Apr 2024 15:21:39 +0200 Subject: [PATCH] fix: enable request logging to simplify debugging --- .../videoservice/config/LoggingConfig.java | 20 +++++++++++++++++++ src/main/resources/application.properties | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/main/java/de/caritas/cob/videoservice/config/LoggingConfig.java diff --git a/src/main/java/de/caritas/cob/videoservice/config/LoggingConfig.java b/src/main/java/de/caritas/cob/videoservice/config/LoggingConfig.java new file mode 100644 index 0000000..0f00aa4 --- /dev/null +++ b/src/main/java/de/caritas/cob/videoservice/config/LoggingConfig.java @@ -0,0 +1,20 @@ +package de.caritas.cob.videoservice.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.filter.CommonsRequestLoggingFilter; + +@Configuration +public class LoggingConfig { + + @Bean + public CommonsRequestLoggingFilter logFilter() { + CommonsRequestLoggingFilter filter = new CommonsRequestLoggingFilter(); + filter.setIncludeQueryString(true); + filter.setIncludePayload(true); + filter.setMaxPayloadLength(10000); + filter.setIncludeHeaders(false); + filter.setAfterMessagePrefix("REQUEST DATA: "); + return filter; + } +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index a2b1680..586fa72 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -79,4 +79,5 @@ spring.security.oauth2.resourceserver.jwt.jwk-set-uri: https://localhost/auth/re spring.jwt.auth.converter.resource-id: app spring.jwt.auth.converter.principal-attribute: preferred_username -springdoc.api-docs.enabled=false \ No newline at end of file +springdoc.api-docs.enabled=false +logging.level.org.springframework.web.filter.CommonsRequestLoggingFilter=DEBUG