Astor.Logging 2024.103.107.12

There is a newer version of this package available.
See the version list below for details.
dotnet add package Astor.Logging --version 2024.103.107.12                
NuGet\Install-Package Astor.Logging -Version 2024.103.107.12                
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="Astor.Logging" Version="2024.103.107.12" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Astor.Logging --version 2024.103.107.12                
#r "nuget: Astor.Logging, 2024.103.107.12"                
#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.
// Install Astor.Logging as a Cake Addin
#addin nuget:?package=Astor.Logging&version=2024.103.107.12

// Install Astor.Logging as a Cake Tool
#tool nuget:?package=Astor.Logging&version=2024.103.107.12                

Astor.Logging

Home for a minimalistic alternative to the JsonConsole logger.

logging.AddMiniJsonConsole();

logger.LogWarning("{name} {age} {hobby}", "Egor", 27, new { Category = "board games", Favorite = "resistance"});
// Output: {"name":"Egor","age":27,"hobby":{"category":"board games","favorite":"resistance"}}

Installation

dotnet add package Astor.Logging

Comparison

Here's what you get with Microsoft's JsonConsole logger:

{
    "EventId": 0,  // omitted by default in MiniJsonConsole
    "LogLevel": "Warning",  // omitted by default in MiniJsonConsole
    "Category": "Astor.Logging.Tests.MiniJsonConsoleLoggerShould", // omitted by default in MiniJsonConsole
    "Message": "Egor 27 { Category = board games, Favorite = resistance }", // Redundant calculated value #1
    "State": {
        "Message": "Egor 27 { Category = board games, Favorite = resistance }", // Redundant calculated value #2
        "name": "Egor",
        "age": 27,
        "hobby": "{ Category = board games, Favorite = resistance }", // Inner data treated as string
        "{OriginalFormat}": "{name} {age} {hobby}" // <- Do you need this?
    }
}

And this is what you get by default with MiniJsonConsole

{
    "name": "Egor",
    "age": 27,
    "hobby": {
        "category": "board games",
        "favorite": "resistance"
    }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.