Diagnostics
Diagnostics in the .NET SDK.
| Symbol | Kind | Summary |
|---|---|---|
NexusDelivery | static class | Marks the window in which the SDK is itself delivering to Nexus. |
NexusDiagnosticLevel | enum | Severity of a message the SDK emits about itself. |
NexusDiagnosticSink | class | Receives the SDK's own diagnostics. |
NexusDelivery
static classstatic class Inverge.Nexus.Diagnostics.NexusDeliveryMarks the window in which the SDK is itself delivering to Nexus.
This exists to break a feedback loop that is otherwise very easy to create.
A logging bridge that forwards ILogger records to the Nexus logs
product is normally registered globally — which means it also sees
HttpClient's own "Sending HTTP request POST ..." records. Those are
produced by the delivery, so forwarding one queues another log line,
whose delivery logs again, forever.
Rather than muting System.Net.Http wholesale — which would also hide
the application's genuine HTTP logs — the client marks its delivery window
here, and any bridge drops records written inside it. The flag is an
AsyncLocal1, so it is correct for concurrent requests and across await`.
Enter()
static methodstatic IDisposable Enter()Marks the current flow as delivering until the returned scope is disposed.
Returns IDisposable
IsDelivering
propertybool IsDelivering { get; }Whether the current execution flow is inside a Nexus delivery.
NexusDiagnosticLevel
enumenum Inverge.Nexus.Diagnostics.NexusDiagnosticLevelSeverity of a message the SDK emits about itself.
| Constant | Description |
|---|---|
const NexusDiagnosticLevel Debug = 0 | Verbose detail, emitted only when Debug is on. |
const NexusDiagnosticLevel Error = 3 | Something failed and could not be worked around. |
const NexusDiagnosticLevel Information = 1 | Normal lifecycle detail. |
const NexusDiagnosticLevel Warning = 2 | Something failed but the SDK carried on — a dropped batch, a retried call. |
NexusDiagnosticSink
classclass Inverge.Nexus.Diagnostics.NexusDiagnosticSinkReceives the SDK's own diagnostics.
The core package has no logging dependency, so it reports through this
delegate instead. Inverge.Nexus.Extensions.Logging wires it to
ILogger for you; set DiagnosticSink directly
if you are not using Microsoft.Extensions.
NexusDiagnosticSink
constructornew NexusDiagnosticSink(object object, IntPtr method)Parameters
Prop
Type
BeginInvoke()
methodIAsyncResult BeginInvoke(NexusDiagnosticLevel level, string message, Exception? exception, AsyncCallback callback, object object)Parameters
Prop
Type
Returns IAsyncResult
EndInvoke()
methodvoid EndInvoke(IAsyncResult result)Parameters
Prop
Type
Invoke()
methodvoid Invoke(NexusDiagnosticLevel level, string message, Exception? exception)Parameters
Prop
Type
