Repository navigation
What's Changed
v2.0 Improves batching support, validation of sink options, thread safety, and disposal mechanisms. It also changes the project's license. Serilog.Sinks.ObservableCollection 2.0 is licensed under the Apache 2.0 license, matching Serilog.
Batching and Sink Configuration Improvements:
- Added a new overload to
LoggerSinkExtensions.ObservableCollectionthat acceptsBatchingOptions, allowing direct configuration of batching behavior. - Added remaining
BatchingOptionstoObservableCollectionSinkOptionsfor configuration through the existing extension method.
Validation and Error Handling:
- Stricter validation is enforced in
ObservableCollectionSinkOptionsand the sink constructor: batch size limit and period must be positive, and retry time limit cannot be negative. Invalid values now throw exceptions, preventing misconfiguration at runtime.
Thread Safety and Disposal:
- Improved thread-safe safety by closing two narrow log/dispose race conditions.
- Added asynchronous (
DisposeAsync) disposal on platforms that support it.
Runtime Targets:
- This project now targets
netstandard2.0andnet10.0
Testing Enhancements:
- Added new tests to ensure exceptions are thrown when invalid batching options are configured, improving test coverage for edge cases.
- Cleaned up test methods by removing redundant comments and unused arrange/act blocks for clarity.
Licensing and Dependency Updates:
- Changed the project license from MIT to Apache License 2.0 for consistency with Serilog's own licensing. (
LICENSE.md) - Updated
Serilogto versions 4.4.0 andMicrosoft.Extensions.*package dependencies to version 10.0.11 (in sample project)