LoggingRealtimeClientBuilderExtensions.UseLogging Method

Definition

Adds logging to the realtime client pipeline.

public static Microsoft.Extensions.AI.RealtimeClientBuilder UseLogging(this Microsoft.Extensions.AI.RealtimeClientBuilder builder, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default, Action<Microsoft.Extensions.AI.LoggingRealtimeClient>? configure = default);
static member UseLogging : Microsoft.Extensions.AI.RealtimeClientBuilder * Microsoft.Extensions.Logging.ILoggerFactory * Action<Microsoft.Extensions.AI.LoggingRealtimeClient> -> Microsoft.Extensions.AI.RealtimeClientBuilder
<Extension()>
Public Function UseLogging (builder As RealtimeClientBuilder, Optional loggerFactory As ILoggerFactory = Nothing, Optional configure As Action(Of LoggingRealtimeClient) = Nothing) As RealtimeClientBuilder

Parameters

loggerFactory
ILoggerFactory

An optional ILoggerFactory used to create a logger with which logging should be performed. If not supplied, a required instance will be resolved from the service provider.

configure
Action<LoggingRealtimeClient>

An optional callback that can be used to configure the LoggingRealtimeClient instance.

Returns

The builder.

Exceptions

builder is null.

Remarks

When the employed ILogger enables Trace, the contents of messages and options are logged. These messages and options may contain sensitive application data. Trace is disabled by default and should never be enabled in a production environment. Messages and options are not logged at other logging levels.

Applies to