Jakar.Json.Logging
10.2.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Jakar.Json.Logging --version 10.2.0
NuGet\Install-Package Jakar.Json.Logging -Version 10.2.0
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="Jakar.Json.Logging" Version="10.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jakar.Json.Logging" Version="10.2.0" />
<PackageReference Include="Jakar.Json.Logging" />
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 Jakar.Json.Logging --version 10.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Jakar.Json.Logging, 10.2.0"
#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 Jakar.Json.Logging@10.2.0
#: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=Jakar.Json.Logging&version=10.2.0
#tool nuget:?package=Jakar.Json.Logging&version=10.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Jakar.Json.Logging
A JSON console formatter for Microsoft.Extensions.Logging that writes [JsonModel] values as structured JSON, using Jakar.Json.
builder.Logging.AddJakarJsonConsole(o => o.IncludeScopes = true);
logger.LogInformation("Placed {Order}", order);
{"Timestamp":"...","EventId":0,"LogLevel":"Information","Category":"Orders","Message":"Placed Order { Id = 7, ... }",
"State":{"Message":"...","Order":{"id" : 7,"customer" : "Zoë","total" : 12.50,"lines" : [...]},"{OriginalFormat}":"Placed {Order}"}}
- Shape: each entry has the same fields as the built-in
JsonConsoleFormatter. Log pipelines that read it keep working. - Models:
[JsonModel]values in the state and scopes, and arrays, lists and collection interfaces of them, are JSON objects and arrays written by Jakar.Json, not theirToString(). - Other values: numbers and booleans stay JSON numbers and booleans, and other values are written as their invariant text. NaN and infinities are written as text, so a log line is always valid JSON.
- Options: the built-in JSON formatter's, including
IncludeScopes,TimestampFormat,UseUtcTimestampandJsonWriterOptions.
Registration binds options from configuration, as AddConsoleFormatter does, so it's annotated as not trimming-safe.
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Jakar.Json (>= 10.2.0)
- Microsoft.Extensions.Logging.Console (>= 10.0.13)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
10.2.0: built against Jakar.Json 10.2.0, whose writers take a ref TWriter; 10.1.0 calls the removed IBufferWriter overloads and throws MissingMethodException with Jakar.Json 10.2.0. 10.1.0: initial release.