InvergeDocs
.NETAPI reference

Diagnostics

Diagnostics in the .NET SDK.

SymbolKindSummary
NexusDeliverystatic classMarks the window in which the SDK is itself delivering to Nexus.
NexusDiagnosticLevelenumSeverity of a message the SDK emits about itself.
NexusDiagnosticSinkclassReceives the SDK's own diagnostics.

NexusDelivery

static class
static class Inverge.Nexus.Diagnostics.NexusDelivery

Marks 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 method
static IDisposable Enter()

Marks the current flow as delivering until the returned scope is disposed.

Returns IDisposable

IsDelivering

property
bool IsDelivering { get; }

Whether the current execution flow is inside a Nexus delivery.

NexusDiagnosticLevel

enum
enum Inverge.Nexus.Diagnostics.NexusDiagnosticLevel

Severity of a message the SDK emits about itself.

ConstantDescription
const NexusDiagnosticLevel Debug = 0Verbose detail, emitted only when Debug is on.
const NexusDiagnosticLevel Error = 3Something failed and could not be worked around.
const NexusDiagnosticLevel Information = 1Normal lifecycle detail.
const NexusDiagnosticLevel Warning = 2Something failed but the SDK carried on — a dropped batch, a retried call.

NexusDiagnosticSink

class
class Inverge.Nexus.Diagnostics.NexusDiagnosticSink

Receives 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

constructor
new NexusDiagnosticSink(object object, IntPtr method)

Parameters

Prop

Type

BeginInvoke()

method
IAsyncResult BeginInvoke(NexusDiagnosticLevel level, string message, Exception? exception, AsyncCallback callback, object object)

Parameters

Prop

Type

Returns IAsyncResult

EndInvoke()

method
void EndInvoke(IAsyncResult result)

Parameters

Prop

Type

Invoke()

method
void Invoke(NexusDiagnosticLevel level, string message, Exception? exception)

Parameters

Prop

Type

On this page