Skip to content

Fix Logback with Spring Boot #4523

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

Merged
merged 4 commits into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes

- Enabling Sentry Logs through Logback in Spring Boot config did not work in 3.15.0 ([#4523](https://github.com/getsentry/sentry-java/pull/4523))

## 8.15.0

### Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ public void start() {

@Override
protected void append(@NotNull ILoggingEvent eventObject) {
if (options.getLogs().isEnabled() && eventObject.getLevel().isGreaterOrEqual(minimumLevel)) {
if (ScopesAdapter.getInstance().getOptions().getLogs().isEnabled()
&& eventObject.getLevel().isGreaterOrEqual(minimumLevel)) {
captureLog(eventObject);
}
if (eventObject.getLevel().isGreaterOrEqual(minimumEventLevel)) {
Expand Down Expand Up @@ -113,7 +114,7 @@ protected void append(@NotNull ILoggingEvent eventObject) {
final Message message = new Message();

// if encoder is set we treat message+params as PII as encoders may be used to mask/strip PII
if (encoder == null || options.isSendDefaultPii()) {
if (encoder == null || ScopesAdapter.getInstance().getOptions().isSendDefaultPii()) {
message.setMessage(loggingEvent.getMessage());
message.setParams(toParams(loggingEvent.getArgumentArray()));
}
Expand Down Expand Up @@ -184,7 +185,7 @@ protected void captureLog(@NotNull ILoggingEvent loggingEvent) {
final @NotNull SentryAttributes attributes = SentryAttributes.of();

// if encoder is set we treat message+params as PII as encoders may be used to mask/strip PII
if (encoder == null || options.isSendDefaultPii()) {
if (encoder == null || ScopesAdapter.getInstance().getOptions().isSendDefaultPii()) {
attributes.add(
SentryAttribute.stringAttribute("sentry.message.template", loggingEvent.getMessage()));
arguments = loggingEvent.getArgumentArray();
Expand Down
Loading