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
<PackageReference Include="Soenneker.Maui.Blazor.BrowserLogger" Version="4.0.201" />
<PackageVersion Include="Soenneker.Maui.Blazor.BrowserLogger" Version="4.0.201" />
<PackageReference Include="Soenneker.Maui.Blazor.BrowserLogger" />
paket add Soenneker.Maui.Blazor.BrowserLogger --version 4.0.201
#r "nuget: Soenneker.Maui.Blazor.BrowserLogger, 4.0.201"
#:package Soenneker.Maui.Blazor.BrowserLogger@4.0.201
#addin nuget:?package=Soenneker.Maui.Blazor.BrowserLogger&version=4.0.201
#tool nuget:?package=Soenneker.Maui.Blazor.BrowserLogger&version=4.0.201
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 | 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.8)
- Microsoft.JSInterop (>= 10.0.8)
- Soenneker.Extensions.CancellationTokens (>= 4.0.17)
- Soenneker.Utils.CancellationScopes (>= 4.0.38)
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 |
Update dependency Microsoft.JSInterop to 10.0.8 (#582)