LoggingRealtimeClientBuilderExtensions.UseLogging Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
- builder
- RealtimeClientBuilder
- 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.