[release/8.0-preview1] Implement RabbitMQ logging (#662)#665
Merged
davidfowl merged 1 commit intorelease/8.0-preview1from Nov 2, 2023
Merged
[release/8.0-preview1] Implement RabbitMQ logging (#662)#665davidfowl merged 1 commit intorelease/8.0-preview1from
davidfowl merged 1 commit intorelease/8.0-preview1from
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.
danmoseley
reviewed
Nov 2, 2023
|
|
||
| protected sealed override void OnEventWritten(EventWrittenEventArgs eventData) | ||
| { | ||
| // Workaround https://github.com/dotnet/corefx/issues/42600 |
Member
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. 😞
danmoseley
reviewed
Nov 2, 2023
|
|
||
| // Special case the Error event so the Exception Details are written correctly | ||
| if (eventData.EventId == 3 && | ||
| eventData.EventName == "Error" && |
Member
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.
davidfowl
approved these changes
Nov 2, 2023
joperezr
approved these changes
Nov 2, 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