Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Sentry’s internal diagnostic logs to respect Spring Boot 3.4 ECS/JSON Structured Logging #4103

Open
dalnoki opened this issue Jan 24, 2025 · 1 comment

Comments

@dalnoki
Copy link

dalnoki commented Jan 24, 2025

Problem Statement

A customer wrote in, they are using Spring Boot 3.4.x with logging.structured.format.console=ecs enabled. Their application logs are all emitted in ECS/JSON format, except for the Sentry SDK’s internal diagnostic logs. Despite having:

implementation("io.sentry:sentry-spring-boot-starter-jakarta")
implementation("io.sentry:sentry-logback")

and being on versions 7.20.0 or 8.0.0, the Sentry logs appear in plain text and include extra line breaks. For example:

INFO: Initializing SDK with DSN: 'https://xxxx'
INFO: No outbox dir path is defined in options.
DEBUG: Serializing object: {
"timestamp": "2025-01-24T08:43:43.574Z",
"exception": {
...
This disrupts the JSON formatting in their log files, making them inconsistent and harder to parse.

Is there a way to make Sentry’s internal diagnostic logs conform to the ECS/JSON format that Spring Boot 3.4 applies to all other logs?

Solution Brainstorm

No response

@adinauer
Copy link
Member

Hey @dalnoki they should be able to achieve this using options.setLogger. This allows them to provide their own implementation that can then log Sentry debug logs in whatever format they need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: Needs Discussion
Development

No branches or pull requests

2 participants