serilog-sinks-elasticsearch icon indicating copy to clipboard operation
serilog-sinks-elasticsearch copied to clipboard

FailureCallback does not expose the Exception that caused the failure

Open staff0rd opened this issue 3 years ago • 9 comments

Does this issue relate to a new feature or an existing bug?

  • [ ] Bug
  • [x] New Feature

Please describe the current behavior? FailureCallback doesn't expose the Exception causing the failure

Please describe the expected behavior? FailureCallback could expose the Exception that caused the failure

I came across this myself, and then saw a similar question on Stackoverflow. Is there any appetite for merging something that would expose the exception, for example, something like this?

staff0rd avatar Feb 02 '21 11:02 staff0rd

The purpose is to somehow store the lost events to some other location, not directly handle the underlying exception. That exception will be the same for all the event that suffered this problem while being stored to Elasticsearch. Like a connection exception. What is your use case that you want to handle this exception as well?

mivano avatar Feb 13 '21 22:02 mivano

The purpose is to somehow store the lost events to some other location, not directly handle the underlying exception. That exception will be the same for all the event that suffered this problem while being stored to Elasticsearch. Like a connection exception. What is your use case that you want to handle this exception as well?

There can be multiple causes on why the logs are not being stored, how would someone fix the issue if there is no error data? You are right, the exception will be the same but in order to research how to fix one needs to know what the actual issue is.

jdiosdado avatar Feb 15 '21 14:02 jdiosdado

+1 I would also like to see the exeption in the failure callback. That would simplify the debugging process as to discover why an event could not be send to elastic. Now I had to make use of a web debugging proxy (Charles)

The logevent even already has an "exeption" property, but it does not get populated.

bferdinandus avatar Mar 01 '22 10:03 bferdinandus

+1 Need this to be able to know the reason for failed events

iamitdubey avatar Mar 01 '22 12:03 iamitdubey

My reason for wanting this is to be able to filter out the failed events which needs to be handled. Like mapper_parsing_exception which I would like to escalate but then ignore stuff like connection errors

Towmeykaw avatar May 11 '22 11:05 Towmeykaw

@mivano Is there a chance to add this feature?

Towmeykaw avatar Jun 07 '22 19:06 Towmeykaw

Looks like something useful based on the feedback. Care for a PR?

mivano avatar Jun 10 '22 17:06 mivano

Hello everybody. I'm in shock! Why is not this problem resolved yet? Do not you have two years enough to fix it?

Rombersoft avatar Apr 04 '23 11:04 Rombersoft

I have merged the mentioned PR, so that should give you a beta package at least.

Regarding the tone of your message; as far as I know, you are not paying for support, and this is part of the deal of using open-source components. See all the reasoning here: https://github.com/serilog-contrib/serilog-sinks-elasticsearch/issues/486

So sorry that you are shocked that this took two years, but do remember this is not my full-time job to maintain an open source framework and do the unpaid tasks for everybody that wants something...

mivano avatar Apr 04 '23 11:04 mivano