Skip to content

Conversation

adinauer
Copy link
Member

📜 Description

Do not use Sentry logging API if logs are disabled

💡 Motivation and Context

Fixes #4571

💚 How did you test it?

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link
Contributor

github-actions bot commented Jul 29, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 447.04 ms 475.08 ms 28.04 ms
Size 1.58 MiB 2.09 MiB 519.49 KiB

@adinauer adinauer changed the title Do not use Sentry logging API if logs are disabled Do not use Sentry logging API in Log4j2 if logs are disabled Jul 29, 2025
@adinauer adinauer merged commit 6c58c54 into main Jul 29, 2025
35 of 38 checks passed
@adinauer adinauer deleted the fix/reduce-noop-warnings-for-log4j2 branch July 29, 2025 12:45
Copy link
Contributor

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Do not use Sentry logging API in Log4j2 if logs are disabled ([#4573](https://github.com/getsentry/sentry-java/pull/4573))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against c9187e9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Excessive logs "Sentry Log is disabled and this 'logger' call is a no-op."
3 participants