assistant.net.logging 0.5.182

dotnet add package assistant.net.logging --version 0.5.182                
NuGet\Install-Package assistant.net.logging -Version 0.5.182                
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="assistant.net.logging" Version="0.5.182" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add assistant.net.logging --version 0.5.182                
#r "nuget: assistant.net.logging, 0.5.182"                
#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 assistant.net.logging as a Cake Addin
#addin nuget:?package=assistant.net.logging&version=0.5.182

// Install assistant.net.logging as a Cake Tool
#tool nuget:?package=assistant.net.logging&version=0.5.182                

assistant.net.logging

Common .net logging extension.

YAML console logging

YAML formatter logging is an extension to .net regular console logger.

using var provider = new ServiceCollection()
    .AddLogging(b => b
      .AddYamlConsole()
      .AddPropertyScope("ApplicationName", () => Thread.CurrentThread.ManagedThreadId)
      .AddPropertyScope("Thread", () => "event-handler-1"))
    .BuildServiceProvider();

var logger = provider.GetRequiredService<ILogger<SomeService>>();
using var _ logger.BeginPropertyScope("RequestId", id);
logger.LogError(ex, "Querying timers: found arranged {TimerCount} timer(s).", count);

Formatting sample

See the YAML formatter written log sample.

Time: 2022-01-01 10:13:59.0192003
Level: Error
EventId: 0
Category: Assistant.Net.Internal.SomeService
Message: Querying timers: found arranged 1 timer(s).
State:
  MessageTemplate: Querying timers: found arranged {TimerCount} timer(s).
  TimerCount: 1
Exception:
  Message: Invalid operation.
  StackTrace: |
    at ConsoleApplication1.SomeObject.OtherMethod() in C:\ConsoleApplication1\SomeObject.cs:line 10
    at ConsoleApplication1.SomeObject..ctor() in C:\ConsoleApplication1\SomeObject.cs:line 20
  InnerException:
    Message: Invalid operation.
    StackTrace: |
      at ConsoleApplication1.SomeObject.OtherMethod() in C:\ConsoleApplication1\SomeObject.cs:line 10
      at ConsoleApplication1.SomeObject..ctor() in C:\ConsoleApplication1\SomeObject.cs:line 20
Scopes:
  - Name: ApplicationName
    Value: event-handler-1
  - Name: Thread
    Value: 24
  - Name: RequestId
    Value: 5793e715-6e50-4f84-9c9e-85be62de689c
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 (3)

Showing the top 3 NuGet packages that depend on assistant.net.logging:

Package Downloads
assistant.net.messaging

Local (in-memory) message handling implementation.

assistant.net.messaging.generic.client

Storage based message handling client.

assistant.net.messaging.generic.server

storage based message handling server.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.5.182 692 5/8/2023
0.4.151 752 3/28/2023
0.4.145 534 3/22/2023
0.4.144 1,317 9/4/2022