Soenneker.Maui.Blazor.BrowserLogger
4.0.245
Prefix Reserved
dotnet add package Soenneker.Maui.Blazor.BrowserLogger --version 4.0.245
NuGet\Install-Package Soenneker.Maui.Blazor.BrowserLogger -Version 4.0.245
<PackageReference Include="Soenneker.Maui.Blazor.BrowserLogger" Version="4.0.245" />
<PackageVersion Include="Soenneker.Maui.Blazor.BrowserLogger" Version="4.0.245" />
<PackageReference Include="Soenneker.Maui.Blazor.BrowserLogger" />
paket add Soenneker.Maui.Blazor.BrowserLogger --version 4.0.245
#r "nuget: Soenneker.Maui.Blazor.BrowserLogger, 4.0.245"
#:package Soenneker.Maui.Blazor.BrowserLogger@4.0.245
#addin nuget:?package=Soenneker.Maui.Blazor.BrowserLogger&version=4.0.245
#tool nuget:?package=Soenneker.Maui.Blazor.BrowserLogger&version=4.0.245
Soenneker.Maui.Blazor.BrowserLogger
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 | Versions 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. |
-
net10.0
- Microsoft.Extensions.Logging (>= 10.0.12)
- Microsoft.JSInterop (>= 10.0.12)
- Soenneker.Extensions.CancellationTokens (>= 4.0.26)
- Soenneker.Extensions.Task (>= 4.0.130)
- Soenneker.Extensions.ValueTask (>= 4.0.123)
- Soenneker.Utils.CancellationScopes (>= 4.0.59)
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.245 | 70 | 9/16/2026 |
| 4.0.243 | 70 | 9/16/2026 |
| 4.0.242 | 77 | 9/15/2026 |
| 4.0.240 | 80 | 9/14/2026 |
| 4.0.239 | 81 | 9/12/2026 |
| 4.0.238 | 91 | 9/12/2026 |
| 4.0.237 | 88 | 9/9/2026 |
| 4.0.236 | 90 | 9/8/2026 |
| 4.0.235 | 98 | 9/4/2026 |
| 4.0.234 | 103 | 9/4/2026 |
| 4.0.233 | 98 | 8/31/2026 |
| 4.0.232 | 96 | 8/30/2026 |
| 4.0.231 | 101 | 8/30/2026 |
| 4.0.230 | 97 | 8/30/2026 |
| 4.0.229 | 97 | 8/30/2026 |
| 4.0.228 | 106 | 8/30/2026 |
| 4.0.227 | 95 | 8/30/2026 |
| 4.0.226 | 101 | 8/29/2026 |
| 4.0.225 | 94 | 8/29/2026 |
| 4.0.224 | 113 | 8/12/2026 |
Update dependency Soenneker.Utils.CancellationScopes to 4.0.59 (#819)