Soenneker.Maui.Blazor.BrowserLogger 4.0.251

Prefix Reserved
dotnet add package Soenneker.Maui.Blazor.BrowserLogger --version 4.0.251
                    
NuGet\Install-Package Soenneker.Maui.Blazor.BrowserLogger -Version 4.0.251
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Maui.Blazor.BrowserLogger" Version="4.0.251" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Maui.Blazor.BrowserLogger" Version="4.0.251" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Maui.Blazor.BrowserLogger" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Maui.Blazor.BrowserLogger --version 4.0.251
                    
#r "nuget: Soenneker.Maui.Blazor.BrowserLogger, 4.0.251"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Maui.Blazor.BrowserLogger@4.0.251
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Maui.Blazor.BrowserLogger&version=4.0.251
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Maui.Blazor.BrowserLogger&version=4.0.251
                    
Install as a Cake Tool

Soenneker.Maui.Blazor.BrowserLogger

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Writes Microsoft.Extensions.Logging messages from a .NET MAUI Blazor app to the browser developer console.

Installation

dotnet add package Soenneker.Maui.Blazor.BrowserLogger

Registration

Add the provider in MauiProgram.cs:

using Soenneker.Maui.Blazor.BrowserLogger.Extensions;

builder.Logging.AddMauiBlazorBrowser();

The provider can receive log entries immediately, but JavaScript output begins after it has an IJSRuntime. Initialize it once from a component that lives for the duration of the BlazorWebView, such as MainLayout.razor:

@inject IJSRuntime JSRuntime
@inject IMauiBlazorJsInteropLoggingService BrowserLogging

@code {
    protected override void OnInitialized()
    {
        BrowserLogging.Initialize(JSRuntime);
    }
}

Add these namespaces to the component or _Imports.razor:

@using Microsoft.JSInterop
@using Soenneker.Maui.Blazor.BrowserLogger.Abstract

Usage

Use the standard ILogger<T> API anywhere in the app:

@inject ILogger<Orders> Logger

@code {
    private void OrderFailed(Exception exception)
    {
        Logger.LogError(exception, "Could not load the order");
    }
}

Trace and debug messages use console.debug, information uses console.info, warnings use console.warn, and errors and critical messages use console.error. Configure category and minimum-level filtering through the normal .NET logging configuration.

Messages are delivered asynchronously and may be lost during shutdown or when the browser cannot keep up. Before initialization, the service retains only the newest buffered messages.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.251 94 10/3/2026
4.0.250 94 9/26/2026
4.0.249 93 9/25/2026
4.0.247 100 9/24/2026
4.0.246 95 9/24/2026
4.0.245 108 9/16/2026
4.0.243 103 9/16/2026
4.0.242 105 9/15/2026
4.0.240 103 9/14/2026
4.0.239 102 9/12/2026
4.0.238 106 9/12/2026
4.0.237 99 9/9/2026
4.0.236 101 9/8/2026
4.0.235 107 9/4/2026
4.0.234 116 9/4/2026
4.0.233 108 8/31/2026
4.0.232 105 8/30/2026
4.0.231 110 8/30/2026
4.0.230 108 8/30/2026
4.0.229 108 8/30/2026
Loading failed

Reuse JavaScript arguments while draining queued log entries