Soenneker.Maui.Blazor.BrowserLogger 4.0.201

Prefix Reserved
dotnet add package Soenneker.Maui.Blazor.BrowserLogger --version 4.0.201
                    
NuGet\Install-Package Soenneker.Maui.Blazor.BrowserLogger -Version 4.0.201
                    
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.201" />
                    
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.201" />
                    
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.201
                    
#r "nuget: Soenneker.Maui.Blazor.BrowserLogger, 4.0.201"
                    
#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.201
                    
#: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.201
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Maui.Blazor.BrowserLogger&version=4.0.201
                    
Install as a Cake Tool

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

alternate text is missing from this package README image Soenneker.Maui.Blazor.BrowserLogger

?? Blazor MAUI Console Logger � Log to the Browser Console Effortlessly


?? What is this?

A custom logger for .NET MAUI Blazor that enables logging to the browser console using IJSRuntime, ensuring logs execute properly on the UI thread. It includes background logging with a periodic timer, ensuring logs are processed even when no UI event occurs.


?? Why Use This?

? Standard MAUI loggers don�t work for browser console output
? Blazor�s IJSRuntime must execute on the UI thread
? .NET loggers process logs on a background thread, causing issues
? Works seamlessly with any ILogger usage across your app


? Features

? Blazor-compatible � Ensures IJSRuntime runs on the UI thread.
? Automatic Logging � Uses a PeriodicTimer to process logs continuously.
? Easy Integration � Fully supports Blazor�s dependency injection system.


?? Installation

Install via NuGet:

dotnet add package BlazorMauiConsoleLogger

?? Setup & Usage

1?? Register the Logger in MauiProgram.cs

Add the logger to the dependency injection container:

builder.Logging.AddMauiBlazorBrowser();

2?? Initialize in MainLayout.razor

Inject IJSRuntime and IMauiBlazorJsInteropLoggingService in a persistent layout or page:

@inject IJSRuntime JsRuntime
@inject IMauiBlazorJsInteropLoggingService LoggingService

@code {
    protected override async Task OnInitializedAsync()
    {
        await LoggingService.Initialize(JsRuntime);
    }
}

3?? Inject & Use the Logger in a Component

@inject ILogger<MyComponent> Logger

@code {
    protected override void OnInitialized()
    {
        Logger.LogInformation("Hello from Blazor Maui Console Logger!");
    }
}

?? Log output in the browser console:

[Information] MyComponent: Hello from Blazor Maui Console Logger!

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.201 93 5/13/2026
4.0.200 90 5/12/2026
4.0.199 104 4/23/2026
4.0.197 97 4/22/2026
4.0.196 99 4/22/2026
4.0.195 98 4/22/2026
4.0.194 96 4/21/2026
4.0.193 107 4/14/2026
4.0.192 101 4/14/2026
4.0.191 119 3/16/2026
4.0.190 95 3/15/2026
4.0.189 105 3/15/2026
4.0.188 103 3/13/2026
4.0.187 97 3/12/2026
4.0.180 104 3/12/2026
4.0.178 92 3/12/2026
4.0.177 104 3/12/2026
4.0.176 106 3/12/2026
4.0.175 101 3/11/2026
4.0.174 102 3/11/2026
Loading failed

Update dependency Microsoft.JSInterop to 10.0.8 (#582)