datalust / serilog-sinks-seq

A Serilog sink that writes events to the Seq structured log server
https://datalust.co/seq
Apache License 2.0
225 stars 50 forks source link

Don't write a spurious `SelfLog` event when disposing an unused sink in durable mode #231

Open nblumhardt opened 1 month ago

nblumhardt commented 1 month ago

Fixes #198

The construction of a bookmark file normally creates one if it doesn't already exist. This PR follows the behavior of the "write" path by also attempting to create the directory if necessary (Directory.CreateDirectory() is idempotent).

Although it can't be exercised currently, this would also prevent a potential startup-time race condition if the shipper were to get started before, or faster than, the file sink.