-
Notifications
You must be signed in to change notification settings - Fork 169
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
Rollup hash does not consider custom Exception data #161
Comments
Yep, this is intentional. When considering a practical "what would this do?" standpoint, it's almost always the same cause of an error with identical call stacks erroring in the same window. So it's about fixing the problem...and doesn't really handle cleaning up. Admittedly, this is based somewhat on Stack Overflow scale of throwing tens of millions of errors in a very short time frame, so I'm not going to pretend my view isn't biased here :) I get the recovery case though, that makes sense if you're using the log as a ledger of sorts. My regret here is the API as it stands (after reading your issue :). If we wanted to roll-up via: I think this is both nice to have, and very messy to implement (in a non-breaking way). Here's what I imagine an API looking like:
...naming TBD, I don't love those, just trying to convey the idea. What do you think about such an API? We could then allow anything there over time, e.g. Thoughts? |
I do like the idea of flags to control the behaviour of roll up, basically exactly what you suggested sounds perfect here and could be done without breaking changes. If I get some time I'll try and throw up a PR and we'll iterate on that until we're happy. |
Though we can do it without a breaking change, technically, we'd have to dupe up a lot of methods and it'd dupe the user's intellisense for logging as well. I'd much rather do this in a 3.x release properly...but if you want to try a PR with minimal breaking and duplication, I'm all for taking a shot. We need to weigh maintenance and user confusion for such a change, though - just being up front there! |
Absolutely agree. Will keep in mind if I take a jab at this |
Not sure if this is intentional or not but currently the GetHash function only includes the
Exception.ToString()
and optionallyMachineName
but it does not consider custom Exception metadata - for example (from opserver):Source for the
GetHash
function:StackExchange.Exceptional/src/StackExchange.Exceptional.Shared/Error.cs
Lines 230 to 244 in 107b864
We find this information helpful to recover from what happened here but what seems to happen is that multiple errors with different information get rolled up into one and only one of the exception's message remains and the others are lost
That's cool if this was intended but thought I'd check, may be worth at least having an option for it like the
MachineName
Happy to do a PR to implement this if you agree that it always should / should have an option to 😄
The text was updated successfully, but these errors were encountered: