Lyo.Diagnostic.AspNetCore
1.0.1
dotnet add package Lyo.Diagnostic.AspNetCore --version 1.0.1
NuGet\Install-Package Lyo.Diagnostic.AspNetCore -Version 1.0.1
<PackageReference Include="Lyo.Diagnostic.AspNetCore" Version="1.0.1" />
<PackageVersion Include="Lyo.Diagnostic.AspNetCore" Version="1.0.1" />
<PackageReference Include="Lyo.Diagnostic.AspNetCore" />
paket add Lyo.Diagnostic.AspNetCore --version 1.0.1
#r "nuget: Lyo.Diagnostic.AspNetCore, 1.0.1"
#:package Lyo.Diagnostic.AspNetCore@1.0.1
#addin nuget:?package=Lyo.Diagnostic.AspNetCore&version=1.0.1
#tool nuget:?package=Lyo.Diagnostic.AspNetCore&version=1.0.1
Lyo.Diagnostic.AspNetCore
ASP.NET Core integration for Lyo.Diagnostic: scoped breadcrumb trails per request and exception recording to the in-memory error inbox plus structured logging, without replacing your existing problem-details middleware.
Examples
Installation
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();
Breadcrumbs in a controller
public sealed class OrdersController(IBreadcrumbTrail breadcrumbs)
{
public async Task<IActionResult> Get(string id)
{
breadcrumbs.Add("orders", "Loading order", new Dictionary<string, string> { ["id"] = id });
// ...
}
}
Pipeline ordering
- This middleware sits closer to route handlers and runs first when an exception unwinds.
- It records the failure and calls
IStructuredLogEnricher, then rethrows. - Outer middleware can still build Problem Details / HTTP error bodies.
Options (DiagnosticWebOptions)
| Property | Purpose |
|---|---|
MinimumSeverity |
Only occurrences at or above this severity are written to the inbox. |
RecordExpectedControlFlow |
When false, expected control-flow classifications are skipped. |
BreadcrumbCapacity |
Max breadcrumbs per request (IBreadcrumbTrail). |
InMemoryInboxMaxOccurrences |
Cap for the singleton InMemoryErrorInbox. |
CorrelationIdHeaders |
Headers tried in order for RequestMetadata.CorrelationId; falls back to TraceIdentifier. |
Breadcrumbs in a controller
Inject IBreadcrumbTrail (scoped) and add entries before risky work:
Do not put secrets or PII in breadcrumb data. See the Lyo.Diagnostic README.
Lyo.Api
Lyo.Api exposes AddLyoApiDiagnosticRecording as a convenience wrapper around AddLyoDiagnosticsWeb.
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.Diagnostic— (direct, lyo)Lyo.Common— (transitive, lyo)Lyo.Exceptions— (transitive, lyo)Lyo.Hashing— (transitive, lyo)Lyo.PackageMetadata— (transitive, lyo)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.Diagnostic (>= 1.0.1)
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.