Skip to content

digitalrmdy/Serilog.Sink.Caching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();