StackTraces of exceptions are lost when events are being logged
Opened this issue · 0 comments
Describe the bug
Sensitive information about stack traces is lost when event is logged to Azure.
To Reproduce
Raise an exception in code. Somewhere in call stack log the exception, then re-throw, then log the same exception again on another step of the call stack.
Expected behavior
2 events are logged.
Exception of the 1st event has StackTrace property corresponding the 1st (!) place in code where exception was handled 1st time and then re-thrown.
Exception of the 2nd event has StackTrace property corresponding the 2nd place in code where exception was handled 2nd time.
Actual behavior
2 events are logged.
Exception of the 1st event has StackTrace property corresponding the 2nd (!) place in code where exception was handled 1st time and then re-thrown.
Exception of the 2nd event has StackTrace property corresponding the 2nd place in code where exception was handled 2nd time.
Additional context
The point here is that the same exception is logged twice on different steps of the call stack. So, I see the same result of the GetHashCode() method when exceptions are being logged . However, StackTrace property always has different values. In my understanding proper solution would be to not store events in BlockingCollection, and instead write events to Stream buffer immediately like in FileSink