-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Don't log a stack trace for AddressInUseException #30154
Don't log a stack trace for AddressInUseException #30154
Conversation
Wait why are we taking this change? Isn't this in the wrong layer? Removing information from loggers is the wrong place to do this sort of filtering. |
Won't argue, it looks weird at best. :) But my understanding is #29801 asks to remove this information from the log without suppressing the exception. (See #29801 (comment)) Maybe I misunderstood the ask. |
Co-authored-by: Chris Ross <[email protected]>
Triage: We think we shouldn't log and just let the exception flow up to the user. |
Ok, I'll make that change. |
@BrennanConroy, done. Updated PR description as well. |
if (ex is not IOException && ex.InnerException is not AddressInUseException) | ||
{ | ||
Trace.LogCritical(0, ex, "Unable to start Kestrel."); | ||
} |
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.
@davidfowl Was your suggestion to no longer log any startup exceptions in KestrelServer? It feels wrong to log everything except AddressInUseExceptions.
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.
Yep, don't log anything here. Just rethrow the exception.
Thanks @BerserkerDotNet! |
@davidfowl I guess we addressed one of the issues mentioned here: #29801 To be specific - There was another issue, which is bigger than the one addressed in this pr. Can we please consider reopening the issue? |
Hi @maxcherednik. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
@maxcherednik , open a new issue please with details. |
In case of AddressInUseException do not log the exception
AddressInUseException:
Other exceptions:
Addresses #29801