fix: route libcurl debug output through SENTRY_TRACE#1854
Merged
Conversation
Replaces `CURLOPT_WRITEDATA = stderr` with `CURLOPT_DEBUGFUNCTION` and a custom `CURLOPT_WRITEFUNCTION` so curl's verbose trace and the HTTP response body flow through `SENTRY_TRACE` instead of being written to `stderr` in debug mode.
f17bcf5 to
153dcea
Compare
JoshuaMoelans
approved these changes
Jul 10, 2026
JoshuaMoelans
left a comment
Member
There was a problem hiding this comment.
LGTM, also agree with putting these in "TRACE" level. Thanks for the cleanup / consolidation 🧹 !!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This is an opinionated behavior change. Previously,
sentry_options_set_debug(options, true)also made libcurl's verbose debug output visible. With this change, that output is routed through the Sentry logger atTRACElevel and is therefore no longer shown by default.Applications that still want the curl/transport diagnostics can opt in:
Using the existing logger level provides explicit control over this useful but noisy output without introducing curl- or transport-specific configuration flags.
Problem A: Sentry logger cannot capture curl output (#887)
CURLOPT_DEBUGFUNCTIONand route curl debug logs through the Sentry logger. As a bonus, this makes curl debug output visible in sentry-daemon logs.Problem B: curl debug output is overly verbose (#555)
SENTRY_TRACE(instead ofSENTRY_DEBUG) to avoid the verbose curl debug output being visible by default when debug logging is enabled.Before
After
Close: #555
Close: #887