Skip to content

Logs are now flushed on shutdown #4503

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 18 commits into from
Jun 25, 2025
Merged

Logs are now flushed on shutdown #4503

merged 18 commits into from
Jun 25, 2025

Conversation

adinauer
Copy link
Member

📜 Description

When SentryClient.flush is invoked (e.g. through ShutdownHookIntegration), we now also flush out logs.

💡 Motivation and Context

On application shutdown, pending logs were not being sent out, e.g. in the Logback sample.

💚 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 Jun 20, 2025

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

Generated by 🚫 dangerJS against e8849f8

Copy link
Contributor

github-actions bot commented Jun 20, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 449.15 ms 512.00 ms 62.85 ms
Size 1.58 MiB 2.09 MiB 519.08 KiB

Previous results on branch: feat/logs-flush

Startup times

Revision Plain With Sentry Diff
8a25310 412.81 ms 428.84 ms 16.03 ms
0aec3fa 413.44 ms 429.06 ms 15.62 ms
c9c186b 405.98 ms 412.61 ms 6.63 ms

App size

Revision Plain With Sentry Diff
8a25310 1.58 MiB 2.09 MiB 518.70 KiB
0aec3fa 1.58 MiB 2.09 MiB 518.84 KiB
c9c186b 1.58 MiB 2.09 MiB 518.84 KiB

Copy link
Member

@lcian lcian left a comment

Choose a reason for hiding this comment

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

LGTM, we can always optimize later if needed

Base automatically changed from feat/logback-logs to main June 24, 2025 12:56
@adinauer adinauer merged commit 9f37401 into main Jun 25, 2025
34 checks passed
@adinauer adinauer deleted the feat/logs-flush branch June 25, 2025 06:46
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