/Serilog.Sink.Caching

Caching sink for serilog

Primary LanguageC#MIT LicenseMIT

Serilog.Sink.Cache

Caching Sink for Serilog This Sink forwards all LogEvents to its output sinks when there is an available network connection. When there is no connection to the internet, all LogEvents are stored in a local database and forwarded as soon as a network connection is detected.

NuGet Badge Build Status CodeFactor Code Smells Maintainability Rating Security Rating Coverage Dependabot Status

Usage

Log.Logger = new LoggerConfiguration()
    .WithCache("connectionString")
        .AddSink(new ConsoleSink(...)          // cache when offline
        .BuildCaching()
    .WriteTo().Console()    // always log here
    .CreateLogger();