Closed SeppPenner closed 3 days ago
It would be good to adjust the readme and add a more concrete example on how to use the IBatchedLogEventSink after the changes made in V4 of Serilog.
IBatchedLogEventSink
Old code:
var batchingOptions = new PeriodicBatchingSinkOptions() { BatchSizeLimit = postgresOptions.BatchSizeLimit, Period = postgresOptions.Period, QueueLimit = postgresOptions.QueueLimit }; var batchingSink = new PeriodicBatchingSink(new PostgreSqlSink(postgresOptions), batchingOptions); return sinkConfiguration.Sink(batchingSink, restrictedToMinimumLevel, levelSwitch);
New code:
var batchingOptions = new BatchingOptions() { BatchSizeLimit = postgresOptions.BatchSizeLimit, BufferingTimeLimit = postgresOptions.Period, QueueLimit = postgresOptions.QueueLimit }; return sinkConfiguration.Sink(new PostgreSqlSink(postgresOptions), batchingOptions, restrictedToMinimumLevel, levelSwitch);
E.g. my complete changes for Serilog.Sinks.Postgresql.Alternative: https://github.com/serilog-contrib/Serilog.Sinks.Postgresql.Alternative/commit/dd282cdd01c694ed586052a023e653d11dda62d1.
Serilog.Sinks.Postgresql.Alternative
Thanks for the suggestion! I'll use your example, let me know if you had any other tweaks in mind :-)
It would be good to adjust the readme and add a more concrete example on how to use the
IBatchedLogEventSink
after the changes made in V4 of Serilog.Old code:
New code:
E.g. my complete changes for
Serilog.Sinks.Postgresql.Alternative
: https://github.com/serilog-contrib/Serilog.Sinks.Postgresql.Alternative/commit/dd282cdd01c694ed586052a023e653d11dda62d1.