-
Notifications
You must be signed in to change notification settings - Fork 831
Description
Serilog.Sinks.PeriodicBatching is used by many, many publicly-available Serilog sinks. Although currently managed as a separate package, it's a fundamental part of the ecosystem.
Over the past two years we've been trying to update Serilog.Sinks.PeriodicBatching to work more efficiently with async and tasks, but moving things forward cleanly has been hampered by ten years of downstream consuming packages in various states of (non-) maintenance.
I've just drafted a PR to revert Serilog.Sinks.PeriodicBatching to its original API, again. My proposal is that after merging it, we put Serilog.Sinks.PeriodicBatching into legacy/maintenance mode, and move IBatchedLogEventSink
into Serilog itself.
Along with the interface, we'd add a WriteTo.Batched()
public API on LoggerConfiguration
, along with a public "options" type to parameterize it, and an internal BatchingSink
implementation. The full cost here would be ~4 types, and a System.Threading.Channels dependency (supported on all current TFMs).
This would present the opportunity we need to nail down a minimal, stable, evolvable API, while promoting batch-oriented sinks to a first-class part of Serilog. Maintained sinks would migrate and drop their PeriodicBatching dependency, while unmaintained sinks could continue using the older package.
Although it may not be in scope for the initial version of the feature, the underlying implementation of the updated batching sink in Serilog could also drive a built-in WriteTo.Async()
, given the current Serilog.Sinks.Async is expected to migrate to a very similar implementation based on System.Threading.Channels in the future.