Open megasuperlexa opened 3 months ago
Hi! Instead of constructing the sink directly, use LoggerSinkConfiguration.Wrap(..
:
var limitingSink = LoggerSinkConfiguration.Wrap(
enclosed => new LimitingSink(enclosed),
wt => wt.Console());
This will work with all existing Serilog sinks, and automatically handles correct IDisposable
and IAsyncDisposable
forwarding to the wrapped sink (removing the need to implement these on your wrapper sink type).
See also https://github.com/serilog/serilog/pull/2060 - HTH!
Hello, what is the reason for making the
ConsoleSink
class internal? I am writing my own ad-hoc limiting sink and cannot make use ofConsoleSink
because it cannot be instantiated and passed inside my sink.I have no problems with
GraylogSink
because it is public, so I propose to makeConsoleSync
public too.