Soenneker.Blazor.LogJson 4.0.1883

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Blazor.LogJson --version 4.0.1883
                    
NuGet\Install-Package Soenneker.Blazor.LogJson -Version 4.0.1883
                    
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.Blazor.LogJson" Version="4.0.1883" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blazor.LogJson" Version="4.0.1883" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Blazor.LogJson" />
                    
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.Blazor.LogJson --version 4.0.1883
                    
#r "nuget: Soenneker.Blazor.LogJson, 4.0.1883"
                    
#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.Blazor.LogJson@4.0.1883
                    
#: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.Blazor.LogJson&version=4.0.1883
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.LogJson&version=4.0.1883
                    
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.Blazor.LogJson

A Blazor interop utility for writing structured values and bounded HTTP bodies to grouped entries in the browser developer console.

Grouped JSON in the browser 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 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 (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 129 9/1/2026
4.0.1884 170 8/31/2026
4.0.1883 149 8/31/2026
4.0.1882 190 8/31/2026
4.0.1881 97 8/30/2026
4.0.1880 169 8/30/2026
4.0.1879 171 8/30/2026
4.0.1878 181 8/30/2026
4.0.1877 80 8/30/2026
4.0.1876 81 8/29/2026
4.0.1875 162 8/29/2026
4.0.1874 77 8/29/2026
4.0.1873 78 8/29/2026
4.0.1872 342 8/26/2026
4.0.1871 239 8/26/2026
4.0.1870 501 8/21/2026
4.0.1869 477 8/18/2026
4.0.1868 536 8/13/2026
4.0.1867 173 8/12/2026
4.0.1866 197 8/9/2026
Loading failed

Update dependency Soenneker.Blazor.Utils.ModuleImport to 4.0.1871 (#3250)