diff --git a/build.gradle.kts b/build.gradle.kts index 628e50e..e2dcc0b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -47,6 +47,8 @@ dependencies { implementation("org.springdoc:springdoc-openapi-starter-webmvc-api:2.5.0") implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0") + implementation("org.zalando:logbook-spring-boot-starter:3.0.0") + compileOnly("org.projectlombok:lombok") developmentOnly("org.springframework.boot:spring-boot-devtools") runtimeOnly("com.h2database:h2") diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..b32a355 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,37 @@ +logging: + level: + org.zalando.logbook: DEBUG + +logbook: + predicate: + include: + - path: /api/** + methods: + - GET + - POST + - path: /actuator/** + exclude: + - path: /actuator/health + - path: /api/admin/** + methods: + - POST + filter.enabled: true + secure-filter.enabled: true + format.style: http + strategy: body-only-if-status-at-least + minimum-status: 400 + obfuscate: + headers: + - Authorization + - X-Secret + parameters: + - access_token + - password + write: + chunk-size: 1000 + attribute-extractors: + - type: JwtFirstMatchingClaimExtractor + claim-names: [ "sub", "subject" ] + claim-key: Principal + - type: JwtAllMatchingClaimsExtractor + claim-names: [ "sub", "iat" ]