[release/8.0-preview1] Implement RabbitMQ logging (#662) - #665
Merged
Conversation
* Implement RabbitMQ logging Add an EventSource listener to listen to the RabbitMQ event source which logs info, warn, and error messages. Forward these messages to an ILogger. Fix #564 * Stop coding like a dinosaur.
Eric Erhardt (eerhardt)
requested review from
Damian Edwards (DamianEdwards),
Dan Moseley (danmoseley) and
David Fowler (davidfowl)
November 2, 2023 19:19
|
|
||
| protected sealed override void OnEventWritten(EventWrittenEventArgs eventData) | ||
| { | ||
| // Workaround https://github.com/dotnet/corefx/issues/42600 |
Contributor
There was a problem hiding this comment.
is this copied from some old place?
looks like this was duped against something else, but indeed that is still active.
Member
Author
There was a problem hiding this comment.
Yes, the original implementation was taken from the Azure SDK.
When was debugging, I was getting OnEventWritten called for EventCounter EventSources that I wasn't even listening to. 😞
|
|
||
| // Special case the Error event so the Exception Details are written correctly | ||
| if (eventData.EventId == 3 && | ||
| eventData.EventName == "Error" && |
Contributor
There was a problem hiding this comment.
is EventName ever not "Error" when EventId is 3?
Member
Author
There was a problem hiding this comment.
I wanted to be super safe here. RabbitMQ has made breaking changes to their event source, so I wanted to ensure we didn't start crashing on a new version if they make even more breaking changes.
David Fowler (davidfowl)
approved these changes
Nov 2, 2023
Eric Erhardt (eerhardt)
requested a review
from Jose Perez Rodriguez (joperezr)
November 2, 2023 22:03
Jose Perez Rodriguez (joperezr)
approved these changes
Nov 2, 2023
Jose Perez Rodriguez (joperezr)
added a commit
that referenced
this pull request
Nov 14, 2023
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Port #662
Customer Impact
Without this, users of the RabbitMQ component won't get logs for error messages, warnings, etc.
Add an EventSource listener to listen to the RabbitMQ event source which logs info, warn, and error messages. Forward these messages to an ILogger.
Fix #564