Soenneker.Blazor.LogJson
4.0.1885
Prefix Reserved
dotnet add package Soenneker.Blazor.LogJson --version 4.0.1885
NuGet\Install-Package Soenneker.Blazor.LogJson -Version 4.0.1885
<PackageReference Include="Soenneker.Blazor.LogJson" Version="4.0.1885" />
<PackageVersion Include="Soenneker.Blazor.LogJson" Version="4.0.1885" />
<PackageReference Include="Soenneker.Blazor.LogJson" />
paket add Soenneker.Blazor.LogJson --version 4.0.1885
#r "nuget: Soenneker.Blazor.LogJson, 4.0.1885"
#:package Soenneker.Blazor.LogJson@4.0.1885
#addin nuget:?package=Soenneker.Blazor.LogJson&version=4.0.1885
#tool nuget:?package=Soenneker.Blazor.LogJson&version=4.0.1885
Soenneker.Blazor.LogJson
A Blazor interop utility for writing structured values and bounded HTTP bodies to grouped entries in the browser developer console.
Installation
dotnet add package Soenneker.Blazor.LogJson
using Soenneker.Blazor.LogJson.Registrars;
builder.Services.AddLogJsonInteropAsScoped();
Inject the service into a component:
@using Soenneker.Blazor.LogJson.Abstract
@inject ILogJsonInterop JsonLog
Log a value
await JsonLog.Log(
new
{
orderId = order.Id,
status = order.Status
},
group: "Order updated",
level: "info");
The value is transferred through Blazor's normal JavaScript serializer. A string beginning with { or [ is parsed as JSON when valid; other strings are logged unchanged. level selects a browser console function such as log, info, warn, or error; an unknown or non-callable member falls back to console.log.
Log an HTTP request or response
using var request = new HttpRequestMessage(HttpMethod.Post, "api/orders")
{
Content = JsonContent.Create(new { sku = "ABC-123", quantity = 2 })
};
await JsonLog.LogRequest(request);
using HttpResponseMessage response = await Http.SendAsync(request);
await JsonLog.LogResponse(response);
Request groups include the method and URI. Response groups include the status plus the originating method and URI when available. These methods log the body only; they do not log request or response headers.
Bodies are buffered up to 64 KiB. A body with a larger declared or observed size is replaced with a skipped-body message, and text over 64K characters is truncated. Logging may buffer otherwise streaming HttpContent, so use these helpers for diagnostics rather than high-throughput production paths.
Sensitive data
Browser-console output is visible to anyone with access to the running browser and may be captured by browser tooling. Do not log authorization data, cookies, access tokens, personal information, payment details, or URLs/query strings containing secrets. Prefer explicitly shaped diagnostic objects over logging entire domain or transport objects.
Interop, serialization, content-read, and cancellation failures are returned to the caller. Await logging when you need to observe those failures; isolate it deliberately if diagnostic logging must never affect the application operation.
| 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
- Soenneker.Blazor.Utils.ModuleImport (>= 4.0.1873)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Blazor.LogJson:
| Package | Downloads |
|---|---|
|
Soenneker.Blazor.ApiClient
A lightweight and efficient API client wrapper for Blazor applications, simplifying HTTP communication with support for asynchronous calls, cancellation tokens, and JSON serialization. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.1885 | 107 | 9/1/2026 |
| 4.0.1884 | 147 | 8/31/2026 |
| 4.0.1883 | 140 | 8/31/2026 |
| 4.0.1882 | 169 | 8/31/2026 |
| 4.0.1881 | 91 | 8/30/2026 |
| 4.0.1880 | 158 | 8/30/2026 |
| 4.0.1879 | 158 | 8/30/2026 |
| 4.0.1878 | 166 | 8/30/2026 |
| 4.0.1877 | 79 | 8/30/2026 |
| 4.0.1876 | 80 | 8/29/2026 |
| 4.0.1875 | 157 | 8/29/2026 |
| 4.0.1874 | 76 | 8/29/2026 |
| 4.0.1873 | 77 | 8/29/2026 |
| 4.0.1872 | 327 | 8/26/2026 |
| 4.0.1871 | 237 | 8/26/2026 |
| 4.0.1870 | 500 | 8/21/2026 |
| 4.0.1869 | 475 | 8/18/2026 |
| 4.0.1868 | 536 | 8/13/2026 |
| 4.0.1867 | 173 | 8/12/2026 |
| 4.0.1866 | 197 | 8/9/2026 |
Updated NuGet packages