InvergeDocs
.NETAPI reference

Logs

Logs in the .NET SDK.

LogsResource

class
class Inverge.Nexus.Resources.LogsResource

Structured logging into the Nexus logs product.

For an app that already uses ILogger, prefer the provider in Inverge.Nexus.Extensions.Logging: register it once and every existing logger.LogInformation(...) lands in Nexus with no call-site changes. This resource is for code that wants to write to Nexus explicitly.

ConstantDescription
const int MaxBatchSize = 1000The most log lines the ingest endpoint accepts in one request.

BatchAsync()

method
Task<int> BatchAsync(IEnumerable<NexusLogEntry> logs, NexusTelemetryContext? context = null, CancellationToken cancellationToken = default)

Sends many log lines immediately, bypassing the buffer.

Parameters

Prop

Type

Returns Task<int> — How many lines the server wrote.

Debug()

method
void Debug(string message, string? source = null, object? logContext = null)

Writes a debug line.

Parameters

Prop

Type

Error()

method
void Error(string message, string? source = null, object? logContext = null)

Writes an error line.

Parameters

Prop

Type

Fatal()

method
void Fatal(string message, string? source = null, object? logContext = null)

Writes a fatal line.

Parameters

Prop

Type

FlushAsync()

method
Task FlushAsync(CancellationToken cancellationToken = default)

Ships every buffered log line right now.

Parameters

Prop

Type

Information()

method
void Information(string message, string? source = null, object? logContext = null)

Writes an info line.

Parameters

Prop

Type

Log()

method
void Log(NexusLogLevel level, string message, string? source = null, object? logContext = null, DateTimeOffset? timestamp = null, NexusTelemetryContext? context = null)

Writes one log line. Returns as soon as it is buffered.

Parameters

Prop

Type

Trace()

method
void Trace(string message, string? source = null, object? logContext = null)

Writes a trace line.

Parameters

Prop

Type

Warning()

method
void Warning(string message, string? source = null, object? logContext = null)

Writes a warn line.

Parameters

Prop

Type

On this page