Soenneker.Maui.Blazor.BrowserLogger
4.0.218
Prefix Reserved
dotnet add package Soenneker.Maui.Blazor.BrowserLogger --version 4.0.218
NuGet\Install-Package Soenneker.Maui.Blazor.BrowserLogger -Version 4.0.218
<PackageReference Include="Soenneker.Maui.Blazor.BrowserLogger" Version="4.0.218" />
<PackageVersion Include="Soenneker.Maui.Blazor.BrowserLogger" Version="4.0.218" />
<PackageReference Include="Soenneker.Maui.Blazor.BrowserLogger" />
paket add Soenneker.Maui.Blazor.BrowserLogger --version 4.0.218
#r "nuget: Soenneker.Maui.Blazor.BrowserLogger, 4.0.218"
#:package Soenneker.Maui.Blazor.BrowserLogger@4.0.218
#addin nuget:?package=Soenneker.Maui.Blazor.BrowserLogger&version=4.0.218
#tool nuget:?package=Soenneker.Maui.Blazor.BrowserLogger&version=4.0.218
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.10)
- Microsoft.JSInterop (>= 10.0.10)
- Soenneker.Extensions.CancellationTokens (>= 4.0.20)
- Soenneker.Utils.CancellationScopes (>= 4.0.46)
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.218 | 79 | 7/21/2026 |
| 4.0.217 | 91 | 7/18/2026 |
| 4.0.216 | 89 | 7/17/2026 |
| 4.0.215 | 96 | 7/16/2026 |
| 4.0.214 | 89 | 7/16/2026 |
| 4.0.213 | 87 | 7/15/2026 |
| 4.0.212 | 98 | 7/14/2026 |
| 4.0.211 | 119 | 6/19/2026 |
| 4.0.210 | 106 | 6/19/2026 |
| 4.0.209 | 108 | 6/18/2026 |
| 4.0.207 | 117 | 6/9/2026 |
| 4.0.206 | 111 | 6/9/2026 |
| 4.0.205 | 106 | 6/6/2026 |
| 4.0.204 | 108 | 6/5/2026 |
| 4.0.203 | 104 | 6/5/2026 |
| 4.0.202 | 110 | 6/5/2026 |
| 4.0.201 | 110 | 5/13/2026 |
| 4.0.200 | 108 | 5/12/2026 |
| 4.0.199 | 122 | 4/23/2026 |
| 4.0.197 | 113 | 4/22/2026 |
Update dependency Soenneker.Utils.CancellationScopes to 4.0.46 (#706)