Skip to content

Commit

Permalink
Add logbook
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-adam committed Sep 15, 2024
1 parent bdab7da commit 1275889
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
37 changes: 37 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -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" ]

0 comments on commit 1275889

Please sign in to comment.