diff --git a/CHANGELOG.md b/CHANGELOG.md index bb38633c0d0..dd255f9fb2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ - Allow multiple UncaughtExceptionHandlerIntegrations to be active at the same time ([#4462](https://github.com/getsentry/sentry-java/pull/4462)) - Prevent repeated scroll target determination during a single scroll gesture ([#4557](https://github.com/getsentry/sentry-java/pull/4557)) - This should reduce the number of ANRs seen in `SentryGestureListener` +- Do not use Sentry logging API in JUL if logs are disabled ([#4574](https://github.com/getsentry/sentry-java/pull/4574)) + - This was causing Sentry SDK to log warnings: "Sentry Log is disabled and this 'logger' call is a no-op." - Do not use Sentry logging API in Log4j2 if logs are disabled ([#4573](https://github.com/getsentry/sentry-java/pull/4573)) - This was causing Sentry SDK to log warnings: "Sentry Log is disabled and this 'logger' call is a no-op." diff --git a/sentry-jul/src/main/java/io/sentry/jul/SentryHandler.java b/sentry-jul/src/main/java/io/sentry/jul/SentryHandler.java index b00c768df47..9c027880c75 100644 --- a/sentry-jul/src/main/java/io/sentry/jul/SentryHandler.java +++ b/sentry-jul/src/main/java/io/sentry/jul/SentryHandler.java @@ -111,7 +111,8 @@ public void publish(final @NotNull LogRecord record) { return; } try { - if (record.getLevel().intValue() >= minimumLevel.intValue()) { + if (ScopesAdapter.getInstance().getOptions().getLogs().isEnabled() + && record.getLevel().intValue() >= minimumLevel.intValue()) { captureLog(record); } if (record.getLevel().intValue() >= minimumEventLevel.intValue()) {