Skip to content

v2.0.0

Latest

Choose a tag to compare

@DillionLowry DillionLowry released this 04 Sep 19:47
0f78dcc

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.ObservableCollection that accepts BatchingOptions, allowing direct configuration of batching behavior.
  • Added remaining BatchingOptions to ObservableCollectionSinkOptions for configuration through the existing extension method.

Validation and Error Handling:

  • Stricter validation is enforced in ObservableCollectionSinkOptions and 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.0 and net10.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 Serilog to versions 4.4.0 and Microsoft.Extensions.* package dependencies to version 10.0.11 (in sample project)