Atya.Diagnostics.Logging 1.0.3

Prefix Reserved
dotnet add package Atya.Diagnostics.Logging --version 1.0.3
                    
NuGet\Install-Package Atya.Diagnostics.Logging -Version 1.0.3
                    
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.3" />
                    
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.3" />
                    
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.3
                    
#r "nuget: Atya.Diagnostics.Logging, 1.0.3"
                    
#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.3
                    
#: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.3
                    
Install as a Cake Addin
#tool nuget:?package=Atya.Diagnostics.Logging&version=1.0.3
                    
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

The ILogger extension methods never throw. A null logger or a disabled log level is a no-op, and a missing or blank name, reason or exception is replaced by a placeholder (UnknownOperation, UnknownDependency, UnknownResource, Unspecified) so that logging inside a catch block can never replace the exception being handled. LogRetryAttempt logs the supplied attempt numbers as given.

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 (3)

Showing the top 3 NuGet packages that depend on Atya.Diagnostics.Logging:

Package Downloads
Atya.Diagnostics.Observation

Unified diagnostics observation helpers that compose logging, metrics, and tracing.

Atya.Hosting.BackgroundServices

Hosted service execution helpers for production .NET workers.

Atya.Web.Middleware

ASP.NET Core middleware that maps Atya exceptions and results to RFC 9457 ProblemDetails at the HTTP edge.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 332 11/27/2026
1.0.2 330 7/7/2026
1.0.2-oidc.20260621.1 98 6/21/2026
1.0.1 582 5/25/2026
1.0.0 261 5/23/2026