Atya.Diagnostics.Logging 1.0.1

dotnet add package Atya.Diagnostics.Logging --version 1.0.1
                    
NuGet\Install-Package Atya.Diagnostics.Logging -Version 1.0.1
                    
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="Atya.Diagnostics.Logging" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Atya.Diagnostics.Logging" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Atya.Diagnostics.Logging" />
                    
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 Atya.Diagnostics.Logging --version 1.0.1
                    
#r "nuget: Atya.Diagnostics.Logging, 1.0.1"
                    
#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 Atya.Diagnostics.Logging@1.0.1
                    
#: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=Atya.Diagnostics.Logging&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Atya.Diagnostics.Logging&version=1.0.1
                    
Install as a Cake Tool

Atya.Diagnostics.Logging

Provider-agnostic structured logging helpers for .NET applications.

Installation

dotnet add package Atya.Diagnostics.Logging

Target framework

This package targets net10.0.

What this package provides

  • Structured scope helpers for correlation, request, trace, user, tenant, operation, entity, and custom properties.
  • Common logging event identifiers for operation, validation, retry, dependency, missing resource, and unexpected exception events.
  • LoggerMessage.Define-based extension methods for common structured log messages.
  • Dependency injection registration for package-owned logging services.

This package builds on Microsoft.Extensions.Logging. It does not configure a concrete logging provider, OpenTelemetry exporter, sink, or storage integration.

Quick start

using Atya.Diagnostics.Logging.Context;
using Atya.Diagnostics.Logging.DependencyInjection;
using Atya.Diagnostics.Logging.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

var services = new ServiceCollection();

services.AddLogging(builder => builder.AddConsole());
services.AddAtyaLogging();

using ServiceProvider provider = services.BuildServiceProvider();
ILogger<Program> logger = provider.GetRequiredService<ILogger<Program>>();

using IDisposable correlationScope = logger.BeginCorrelationScope("corr-123");
using IDisposable tenantScope = logger.BeginTenantScope("tenant-1");
using IDisposable operationScope = logger.BeginOperationScope("ProcessOrder", "corr-123");

logger.LogOperationStarted("ProcessOrder", 1001);

try
{
    logger.LogRetryAttempt("ChargePayment", attemptNumber: 1, maxAttempts: 3);
    logger.LogOperationCompleted("ProcessOrder", 1001);
}
catch (Exception exception)
{
    logger.LogDependencyFailure(exception, "PaymentGateway", 1001);
    logger.LogOperationFailed(exception, "ProcessOrder", 1001);
}

Custom scopes

using Atya.Diagnostics.Logging.Context;

using IDisposable scope = logger.BeginPropertyScope(
    new[]
    {
        new LogContextProperty(KnownLogPropertyNames.UserId, "user-1"),
        new LogContextProperty("Feature", "Checkout")
    });

Blank property names are ignored when a LogScopeState is created from key/value pairs. Named scope helpers throw for null, empty, or whitespace identifiers.

Exceptions

Argument validation is implemented with Atya.Foundation.Guards. Most extension methods throw ArgumentNullException for a null ILogger, required exception argument, or required string argument. Methods that require names or identifiers throw ArgumentException when those values are empty or whitespace. LogRetryAttempt throws ArgumentOutOfRangeException when attempt numbers are less than one or the current attempt is greater than the maximum attempt count.

Versioning

Stable releases use SemVer package versions derived from vMAJOR.MINOR.PATCH release tags.

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 Atya.Diagnostics.Logging:

Package Downloads
Atya.Diagnostics.Observation

Thin diagnostics composition package over logging, tracing, and metrics.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 151 5/25/2026
1.0.0 214 5/23/2026