<PackageReference Include="OpenTelemetry" Version="1.21.0-rc.1" />

OpenTelemetry.SelfDiagnostics.SelfDiagnosticsOptions

public sealed class SelfDiagnosticsOptions
Options for configuring SDK self-diagnostics logging.

Gets or sets how much of the OTEL_* environment variable snapshot is written to the log file preamble. Defaults to KnownSafeValues, which lists every variable name but redacts the value of any variable the SDK does not recognise as safe to disclose. Only applies when file logging is enabled.

public int FileSizeLimitKilobytes { get; set; }

Gets or sets the size in kilobytes at which the current log file is closed and a new one is started. Defaults to 10240 (10 MiB). A value less than or equal to zero disables size-based rollover.

public string LogDirectory { get; set; }

Gets or sets the folder where self-diagnostics log files are written. Setting a non-empty value enables file logging. Defaults to null (no file logging).

public bool LogToStderr { get; set; }

Gets or sets a value indicating whether SDK diagnostics are written to standard error.

public bool LogToStdout { get; set; }

Gets or sets a value indicating whether SDK diagnostics are written to standard output.

public int MaxRetainedFiles { get; set; }

Gets or sets the maximum number of log files to keep. When a new file is started, the oldest files are deleted to stay within this limit. Defaults to 10. A value less than or equal to zero keeps all files.

public LogLevel MinimumLevel { get; set; }

Gets or sets the minimum log level. Events below this level are discarded, and None disables logging. Defaults to Warning.

Initializes a new instance of the SelfDiagnosticsOptions class.

public static string GetDefaultLogDirectory()

Gets the standard per-user folder for self-diagnostics log files on the current platform.