MindscapeHQ / serilog-sinks-raygun

A Serilog sink that writes events to Raygun
Apache License 2.0
11 stars 20 forks source link

Adding on before send action #50

Closed PanosNB closed 1 year ago

PanosNB commented 1 year ago

This PR enables the execution of user function (Action) right before a message is sent to Raygun. The function is passed as an argument to the RaygunSink constructor (null default). It is executed by the raygun client's CustomGroupingKey event, and happens at the end of the OnCustomGroupingKey event callback. The new onBeforeSend callback takes a single input: a struct instance (call-stack allocated) of type OnBeforeSendParameters that future-proofs adding new fields to it. Currently, it holds a pointer to the Exception being handled and the RaygunMessage to be sent to Raygun.

Two new test files have been added with test cases around the new behavior and the new struct

PanosNB commented 1 year ago

Thanks @QuantumNightmare! I'm proceeding with merging this is and if something else is needed, we can look into it before merging into master

jlinker7 commented 1 year ago

@PanosNB and @QuantumNightmare thanks! I am going to run some tests with this later and verify it works with my scenario (thank you for updating the documentation with my specific example!). If no other issues are found, any idea how long it might be before the update is released, so I can plan things on my end?

PanosNB commented 1 year ago

Hi @jlinker7 , version 5.2.0 is up! https://www.nuget.org/packages/Serilog.Sinks.Raygun/5.2.0 Thanks for your work on this! Looking forward to any other comments and ideas you might have!