Repository navigation
feat: log flag updates from the listener; pass exceptions in PSR-3 context - #5
Merged
Merged
Conversation
…ntext
The listener now logs 'Reflag flags updated to version {version}' at debug when a flags-updated event triggers a refresh (the .NET SDK logs every refresh at info; PHP refreshes on request paths too, so only the listener logs). Connect and stream failures also pass the Throwable as 'exception' so Monolog, Sentry and Flare keep the stack trace. Other log sites still log only the exception class: store, fallback and cloud errors can carry hosts or SAS URLs.
roncohen
enabled auto-merge
December 3, 2026 10:47
This was referenced Dec 3, 2026
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.
Compared the listener's logging with the .NET SDK (
FlagUpdatesSse.cs) and closed two gaps.flags-updatedevent the listener now logsReflag flags updated to version {version}at debug. .NET logsrefreshed flag definitionsat info on every refresh; PHP also refreshes on request paths across many workers, so only the listener logs, at debug.exceptioncontext key for connect failures and stream failures, so Monolog, Sentry and Flare keep the stack trace (the .NET SDK passes the exception object). The message text is unchanged.Other log sites still log only the exception class on purpose: store, fallback and cloud errors can carry hostnames or SAS URLs.
Verified live against front.reflag.com: GET /sse/server with Bearer auth,
reflag-sdk-version,Accept: text/event-streamandCache-Control: no-cachereturned 200text/event-stream. The listener connected, refreshed to version 24 and stayed connected for 40 s.Tests: full suite passes (1447 tests), PHPStan clean;
ListenerTestasserts the new debug line and theexceptionkey.