sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Integration for Sentry Logs through Logback

Open adinauer opened this issue 9 months ago • 2 comments

Problem Statement

For the logs feature we want to have an integration for Logback.

Solution Brainstorm

No response

adinauer avatar May 14 '25 16:05 adinauer

Looking forward to this integration. 👍

I think the most straightforward solution would be to implement a custom appender for Sentry Logs.

See Logback's doc, Baeldung article and logz.io implementation (or other examples).

mfillon avatar Jun 03 '25 11:06 mfillon

Hey @mfillon thanks for the feedback. We already have a custom SentryAppender which we're planning to make configurable to also send logs >= a certain log level to Sentry as logs. We already have similar config for breadcrumb and error event levels so this should fit in nicely.

adinauer avatar Jun 12 '25 11:06 adinauer

We have just released https://github.com/getsentry/sentry-java/releases/tag/8.15.0 which includes support for sending log messages from Logback to Sentry using the new structured logs.

Docs are available for pure Logback usage as well as combining Spring Boot and Logback.

adinauer avatar Jun 25 '25 15:06 adinauer