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.
Log.Logger = new LoggerConfiguration()
.WithCache("connectionString")
.AddSink(new ConsoleSink(...) // cache when offline
.BuildCaching()
.WriteTo().Console() // always log here
.CreateLogger();