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
<PackageReference Include="Atya.Diagnostics.Logging" Version="1.0.3" />
<PackageVersion Include="Atya.Diagnostics.Logging" Version="1.0.3" />
<PackageReference Include="Atya.Diagnostics.Logging" />
paket add Atya.Diagnostics.Logging --version 1.0.3
#r "nuget: Atya.Diagnostics.Logging, 1.0.3"
#:package Atya.Diagnostics.Logging@1.0.3
#addin nuget:?package=Atya.Diagnostics.Logging&version=1.0.3
#tool nuget:?package=Atya.Diagnostics.Logging&version=1.0.3
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 | Versions 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. |
-
net10.0
- Atya.Foundation.Guards (>= 1.0.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.15)
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 |