Reputation: 504
Is there a way to retrieve all the LogProperties that have been pushed into a current Context? We have a separate system we push events to for Exceptions but would like to access all the properties that have been loaded up in to the LogProperties throughout the call chain.
I see that the TestCorrelator builds some mechanism to grab them, but the ability to view all the currently pushed LogProperties should be exposed somewhere right? I just can't find it.
If not, is there a way we can intercept Log.Error and just use that code to push the exception to a third party service?
Upvotes: 2
Views: 1865
Reputation: 21
Yes you can do that by writing your own sink, implement ILogEventSink. There you will get properties in the logevent object, you can get the context property to match for your specific context call and all other properties which are pushed with the log.
Upvotes: 1