Astor.Logging 2024.106.109.25-comparison-artifacts

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

// Install Astor.Logging as a Cake Tool
#tool nuget:?package=Astor.Logging&version=2024.106.109.25-comparison-artifacts&prerelease                

Astor.Logging

Home for a minimalistic alternative to the JsonConsole logger.

logging.AddMiniJsonConsole();

logger.LogInformation("We have a guest {name} {age}", "Egor", 27);
// Output: {"name":"Egor","age":27}

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"
    }
}

Note that you can also set up MiniJsonConsole to include LogLevel, LogEventId, and LogCategoryName. Check out MiniJsonConsoleLoggerShould for more examples.

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.