Table of Contents

Class ScopedRemoteApiSink

Namespace
Cognite.Simulator.Utils
Assembly
Cognite.Simulator.Utils.dll

Represents a sink for emitting log events to a remote API.

public class ScopedRemoteApiSink : ILogEventSink
Inheritance
ScopedRemoteApiSink
Implements
ILogEventSink
Inherited Members

Constructors

ScopedRemoteApiSink(LoggerConfig)

Create a scoped api sink

public ScopedRemoteApiSink(LoggerConfig loggerConfig)

Parameters

loggerConfig LoggerConfig

The logger configuration

Methods

Emit(LogEvent)

Store the log in the buffer to be sent to the remote API.

public void Emit(LogEvent logEvent)

Parameters

logEvent LogEvent

The log event to emit.

Flush(SimulatorsResource, CancellationToken)

Flushes the logs to the remote API and clears the buffer.

public Task Flush(SimulatorsResource client, CancellationToken token)

Parameters

client SimulatorsResource

Simulator resource client

token CancellationToken

Cancellation token

Returns

Task

SetDefaultLogId(long)

Sets the default log ID.

public void SetDefaultLogId(long logId)

Parameters

logId long

The default log ID to set.