-
Notifications
You must be signed in to change notification settings - Fork 308
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
[release/8.0-preview1] Implement RabbitMQ logging (#662) #665
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.
|
||
protected sealed override void OnEventWritten(EventWrittenEventArgs eventData) | ||
{ | ||
// Workaround https://github.com/dotnet/corefx/issues/42600 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this copied from some old place?
looks like this was duped against something else, but indeed that is still active.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is EventName ever not "Error" when EventId is 3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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