Serilog.Sinks.BrowserConsole
A console sink for the Blazor/Wasm environment.
What's it do?
The sink writes log events to the browser console. Unlike the normal Serilog console sink, which writes out formatted text, this sink takes advantage of the unique capabilities of the browser console to print interactive, fully-structured data.
Getting started
Configure the logging pipeline in Program.Main()
:
// dotnet add package Serilog.Sinks.BrowserConsole -v ...
Log.Logger = new LoggerConfiguration()
.WriteTo.BrowserConsole()
.CreateLogger();
Log.Information("Hello, browser!");
A more detailed example is available in this repository.