Skip to content

Add logging utilities and logback default config#17

Merged
vlaurin merged 5 commits intomainfrom
logging
Feb 11, 2025
Merged

Add logging utilities and logback default config#17
vlaurin merged 5 commits intomainfrom
logging

Conversation

@vlaurin
Copy link
Copy Markdown
Contributor

@vlaurin vlaurin commented Feb 5, 2025

⚠️ This uses Logback's new native JSON support instead of the non-maintained 3rd contrib library previously used in quickcase/spring-logging. As a result, the structure of the JSON logs is changing as Logback's flavour is opinionated and less configurable.

Let Spring drives versions of dependencies in accordance with BOM of version of Spring Boot currently used
Provides transitive dependency on `jakarta.servlet` package required to write HTTP request filters for Spring Boot
This prepares this library to replace the legacy quickcase/spring-logging project
@vlaurin vlaurin added the type:breaking Breaking change label Feb 5, 2025
@vlaurin vlaurin requested a review from gbenadikar February 5, 2025 17:50
Re-use Spring Boot default logback configuration but extends with structured JSON format used by default.
Servlet filters migrated from quickcase/data-store to:
- log access requests
- clear MDC per request (avoid MDC leaks)
- group logs per requests using request trace ID

For convenience a configuration class is provided to be imported in consuming web apps.
@vlaurin vlaurin marked this pull request as ready for review February 11, 2025 12:21
@vlaurin vlaurin merged commit 3cbd661 into main Feb 11, 2025
2 checks passed
@vlaurin vlaurin deleted the logging branch February 11, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:breaking Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants