Logs
Logs in the .NET SDK.
LogsResource
classclass Inverge.Nexus.Resources.LogsResourceStructured 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.
| Constant | Description |
|---|---|
const int MaxBatchSize = 1000 | The most log lines the ingest endpoint accepts in one request. |
BatchAsync()
methodTask<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()
methodvoid Debug(string message, string? source = null, object? logContext = null)Writes a debug line.
Parameters
Prop
Type
Error()
methodvoid Error(string message, string? source = null, object? logContext = null)Writes an error line.
Parameters
Prop
Type
Fatal()
methodvoid Fatal(string message, string? source = null, object? logContext = null)Writes a fatal line.
Parameters
Prop
Type
FlushAsync()
methodTask FlushAsync(CancellationToken cancellationToken = default)Ships every buffered log line right now.
Parameters
Prop
Type
Information()
methodvoid Information(string message, string? source = null, object? logContext = null)Writes an info line.
Parameters
Prop
Type
Log()
methodvoid 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()
methodvoid Trace(string message, string? source = null, object? logContext = null)Writes a trace line.
Parameters
Prop
Type
Warning()
methodvoid Warning(string message, string? source = null, object? logContext = null)Writes a warn line.
Parameters
Prop
Type
