serilog / serilog-sinks-async

An asynchronous wrapper for Serilog sinks that logs on a background thread
Apache License 2.0
231 stars 30 forks source link

HealthMonitor full example #79

Closed alex0598 closed 4 months ago

alex0598 commented 2 years ago

Hi is there an example of the HealthMonitor for C# ?

bartelink commented 2 years ago

No, there is no complete sample (I wrote some code in the context of a larger system, but it was closed source) There are tests in this repo that cover some of the config wiring, but their aim is not to illustrate something like that - they are focused on proving that the right calls happen at the right time, and to prove that blocking and/or dropping works as specified.

raheinz57 commented 1 year ago

The monitor implementation can be configured using a Serilog hook in appsettings.json. I have uploaded an implementation that loads the monitor via appsettings.json AsyncMonitorHook.zip