Skip to content

feat(jul): [Logs and Metrics Enable Flags 3] Add Logs opt-in - #5942

Open
adinauer wants to merge 2 commits into
feat/logs-opt-in-log4j2from
feat/logs-opt-in-jul
Open

feat(jul): [Logs and Metrics Enable Flags 3] Add Logs opt-in#5942
adinauer wants to merge 2 commits into
feat/logs-opt-in-log4j2from
feat/logs-opt-in-jul

Conversation

@adinauer

@adinauer adinauer commented Aug 12, 2026

Copy link
Copy Markdown
Member

PR Stack (Logs and Metrics Enable Flags)


📜 Description

Adds an enableLogs option to the JUL SentryHandler. The option defaults to false, exposes a public Java getter/setter, and can be configured through LogManager with io.sentry.jul.SentryHandler.enableLogs=true.

The handler requires both this local opt-in and the existing aggregate core Logs flag before forwarding records as Sentry Logs. Event and breadcrumb capture remain unchanged.

💡 Motivation and Context

Logging integrations need explicit local opt-ins before the aggregate core Logs flag can be removed later in this stack. JUL applications can opt in through either programmatic configuration or their existing logging.properties setup.

💚 How did you test it?

  • ./gradlew spotlessApply apiDump
  • ./gradlew :sentry-jul:test
  • Added tests for default-disabled, Java and LogManager opt-in behavior, and independent event/breadcrumb capture

📝 Checklist

  • I added GH Issue ID & Linear ID
  • 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

Continue adding integration-local Logs opt-ins before removing the aggregate core Logs flag.

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

adinauer and others added 2 commits August 12, 2026 16:07
Require an explicit JUL handler opt-in before forwarding records as Sentry Logs. Support Java and LogManager configuration while keeping event and breadcrumb capture unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 17f0881

@sentry

sentry Bot commented Aug 12, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.52.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 325.35 ms 381.94 ms 56.59 ms
Size 0 B 0 B 0 B

This was referenced Aug 12, 2026
@adinauer
adinauer marked this pull request as ready for review August 13, 2026 13:40

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as the other if we decide to change how this is named

Comment thread CHANGELOG.md

### Features

- Add an explicit Logs opt-in to the JUL handler ([#5942](https://github.com/getsentry/sentry-java/pull/5942))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably consolidate these once the stack is merged

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! same comment as the other if we decide to change how this is named

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.

2 participants