Share via


LoggingHostedFileClientBuilderExtensions.UseLogging Method

Definition

Adds logging to the hosted file client pipeline.

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

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<LoggingHostedFileClient>

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

Returns

The builder.

Remarks

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

Applies to