Skip to main content
net8.0

Writes Serilog events to the browser console

Published
Jul 12, 2024
2y ago
Total Downloads
2.8M
2,777,884

Install

dotnet add package Serilog.Sinks.BrowserConsole --version 8.0.0
ProductVersions
.NET
net8.0

README

Serilog.Sinks.BrowserConsole Build status NuGet Pre Release

A Serilog sink that takes advantage of the unique features of the browser console in the Blazor/WASM applications.

Versioning: This package tracks the versioning and target framework support of its Microsoft.AspNetCore.Components.WebAssembly dependency. Most users should choose the version of Serilog.Sinks.BrowserConsole that matches their application's target framework. I.e. if you're targeting .NET 7.x, choose a 7.x version of Serilog.Sinks.BrowserConsole. If you're targeting .NET 8.x, choose an 8.x Serilog.Sinks.BrowserConsole version, and so on.

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.

Serilog.Sinks.BrowserConsole

Getting started

Configure the logging pipeline in Program.Main():

// dotnet add package Serilog.Sinks.BrowserConsole

Log.Logger = new LoggerConfiguration()
    .WriteTo.BrowserConsole()
    .CreateLogger();

Log.Information("Hello, browser!");

A more detailed example is available in this repository.

Changes from Previous Version

No structural changes between v8.0.0-dev-00065 and v8.0.0.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.