Skip to content

Instantly share code, notes, and snippets.

@KrzysztofCwalina
Last active July 30, 2025 19:05
Show Gist options
  • Select an option

  • Save KrzysztofCwalina/936bd1c0d7dd613a9b8149145fd30e2b to your computer and use it in GitHub Desktop.

Select an option

Save KrzysztofCwalina/936bd1c0d7dd613a9b8149145fd30e2b to your computer and use it in GitHub Desktop.
Logging options
// dotnet package add Microsoft.Extensions.Logging.Console
ClientLoggingOptions loggingOptions = new()
{
EnableLogging = true,
EnableMessageContentLogging = true,
EnableMessageLogging = true,
LoggerFactory = LoggerFactory.Create(builder => builder
.AddConsole()
.SetMinimumLevel(LogLevel.Trace))
};
OpenAIClientOptions options = new()
{
ClientLoggingOptions = loggingOptions
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment