-
Notifications
You must be signed in to change notification settings - Fork 592
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
HandleMainLoopException puts exception StackTrace in the EventSource Message #1493
Comments
This was referenced Feb 9, 2024
Feel free to open a PR targeting |
eerhardt
added a commit
to eerhardt/rabbitmq-dotnet-client
that referenced
this issue
Feb 9, 2024
When logging connection exception information to the EventSoruce we are putting the full exception ToString in the Message which clutters it to the users. Instead, just put the Exception.Message in the EventSource event message. The full exception information comes in the details of the EventSource event. Fix rabbitmq#1493
11 tasks
lukebakken
pushed a commit
that referenced
this issue
Feb 12, 2024
When logging connection exception information to the EventSoruce we are putting the full exception ToString in the Message which clutters it to the users. Instead, just put the Exception.Message in the EventSource event message. The full exception information comes in the details of the EventSource event. Fix #1493
lukebakken
added a commit
that referenced
this issue
Feb 12, 2024
Merged
lukebakken
added a commit
that referenced
this issue
Feb 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When a connection exception happens, we log a message to the
RabbitMqClientEventSource
. However, the full exception ToString is being logged in theMessage
of the EventSource event.Reproduction steps
EventListener
to therabbitmq-client
EventSource.This can easily be done with a .NET Aspire app that uses the RabbitMQ component and looking in the Structured Logs entry for the exception.
Expected behavior
The Message should only contain the message information. Not the StackTrace.
Additional context
I believe the issue is isolated to the
HandleMainLoopException
method. The other places that log exceptions all appear to pass the caught exception into the logging correctly.In
HandleMainLoopException
, it puts theShutdownEventArgs
ToString() into the message.rabbitmq-dotnet-client/projects/RabbitMQ.Client/client/impl/Connection.Receive.cs
Lines 176 to 187 in 1d5b36a
And the
ShutdownEventArgs
ToString() puts the fullexception.ToString()
in the result:rabbitmq-dotnet-client/projects/RabbitMQ.Client/client/api/ShutdownEventArgs.cs
Lines 129 to 137 in dd10278
We could fix this by adding a new method like "GetEventLogMessage()" method that contains all this information, but doesn't include the full ToString of the exception in the message.
See dotnet/aspire#2118 (comment) for more details.
The text was updated successfully, but these errors were encountered: