Lyo.Diagnostic.AspNetCore
2.0.0
dotnet add package Lyo.Diagnostic.AspNetCore --version 2.0.0
NuGet\Install-Package Lyo.Diagnostic.AspNetCore -Version 2.0.0
<PackageReference Include="Lyo.Diagnostic.AspNetCore" Version="2.0.0" />
<PackageVersion Include="Lyo.Diagnostic.AspNetCore" Version="2.0.0" />
<PackageReference Include="Lyo.Diagnostic.AspNetCore" />
paket add Lyo.Diagnostic.AspNetCore --version 2.0.0
#r "nuget: Lyo.Diagnostic.AspNetCore, 2.0.0"
#:package Lyo.Diagnostic.AspNetCore@2.0.0
#addin nuget:?package=Lyo.Diagnostic.AspNetCore&version=2.0.0
#tool nuget:?package=Lyo.Diagnostic.AspNetCore&version=2.0.0
Lyo.Diagnostic.AspNetCore
ASP.NET Core integration for Lyo.Diagnostic. Per-request scoped breadcrumb trails and exception recording to the in-memory error inbox plus structured logging, without replacing existing problem-details middleware.
Examples
Install
using Lyo.Diagnostic.AspNetCore;
builder.Services.AddLyoDiagnosticsWeb(o =>
{
o.MinimumSeverity = Lyo.Diagnostic.Classification.ExceptionSeverity.Low;
o.BreadcrumbCapacity = 100;
o.InMemoryInboxMaxOccurrences = 5_000;
o.CorrelationIdHeaders = ["X-Correlation-Id", "X-Request-Id"];
});
// After outer middleware that catches and formats errors (e.g. LoggingMiddleware):
app.UseDiagnosticExceptionRecording();
Controller breadcrumbs
public sealed class OrdersController(IBreadcrumbTrail breadcrumbs)
{
public async Task<IActionResult> Get(string id)
{
breadcrumbs.Add("orders", "Loading order", new Dictionary<string, string> { ["id"] = id });
// ...
}
}
Order in the pipeline
- Placed nearer the route handlers, this middleware is first in line when an exception unwinds.
- It records the failure, calls
IStructuredLogEnricher, then rethrows. - Problem Details / HTTP error bodies can still be built by outer middleware.
Options (DiagnosticWebOptions)
| Property | What it does |
|---|---|
MinimumSeverity |
The inbox only stores occurrences at this severity or higher. |
RecordExpectedControlFlow |
Expected control-flow classifications are skipped when this is false. |
BreadcrumbCapacity |
Per-request breadcrumb ceiling (IBreadcrumbTrail). |
InMemoryInboxMaxOccurrences |
Upper bound for the singleton InMemoryErrorInbox. |
CorrelationIdHeaders |
Tried in order for RequestMetadata.CorrelationId; TraceIdentifier is the fallback. |
Controller breadcrumbs
Resolve scoped IBreadcrumbTrail and record entries before risky work:
Keep secrets and PII out of breadcrumb data. See the Lyo.Diagnostic README.
Lyo.Api
AddLyoApiDiagnosticRecording on Lyo.Api wraps AddLyoDiagnosticsWeb.
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.Common.Core(direct, lyo)Lyo.Diagnostic(direct, lyo)Lyo.Common.Metadata(transitive, lyo)Lyo.Exceptions(transitive, lyo)Lyo.Hashing(transitive, lyo)Lyo.PackageMetadata(transitive, lyo)Microsoft.Bcl.AsyncInterfaces10.0.5(transitive, microsoft, netstandard2.0)Microsoft.Extensions.DependencyInjection.Abstractions10.0.5(transitive, microsoft)Microsoft.Extensions.Logging.Abstractions10.0.5(transitive, microsoft)System.IO.Hashing10.0.5(transitive, microsoft, net10.0)System.Memory4.6.3(transitive, microsoft, netstandard2.0)System.Text.Json10.0.5(transitive, microsoft, netstandard2.0)System.Threading.Tasks.Extensions4.6.3(transitive, microsoft)
| 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
- Lyo.Common.Core (>= 2.0.0)
- Lyo.Diagnostic (>= 2.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Lyo.Diagnostic.AspNetCore:
| Package | Downloads |
|---|---|
|
Lyo.Api
Core API library for building RESTful APIs with Entity Framework Core, caching, and mapping support. |
|
|
Lyo.Authentication.Client
Consumer-side runtime for Lyo.Authentication. Used by Gateway / web hosts that need to redeem a Lyo handoff code, maintain a server-side session keyed by an HttpOnly cookie, project the signed-in Lyo user into Blazor's AuthenticationStateProvider, and inject a Bearer header on outbound API calls (with automatic refresh on 401). Pairs with the Lyo.Authentication.OpenIdConnect endpoints on the API side. |
GitHub repositories
This package is not used by any popular GitHub repositories.