Skip to content

Latest commit

 

History

History
40 lines (24 loc) · 1.74 KB

Enable-OtelDiagnosticLog.md

File metadata and controls

40 lines (24 loc) · 1.74 KB

Enable-OtelDiagnosticLog

Create the OTEL_DIAGNOSTICS.json file to enable the internal logs generated by all OpenTelemetry components.

Parameters

Parameter Set 1

  • [String] LogDirectory The directory where the output log file will be stored. It can be an absolute path or a relative path to the current directory. Default is current directory.
  • [Int32] FileSize Specifies the log file size in KiB. The log file will never exceed this configured size, and will be overwritten in a circular way. Default is 32768.
  • [Diagnostics.Tracing.EventLevel] LogLevel The lowest level of the events to be captured. Default is Warning.

Examples

Example 1

Write an Otel Diagnostic log to C:\logs.

Enable-OtelDiagnosticLog -LogDirectory C:\logs

Example 2

Includes the Error and Critical levels.

Enable-OtelDiagnosticLog -LogLevel Warning

Links

Notes

The self-diagnostics feature can be enabled/changed/disabled while the process is running (without restarting the process). The SDK will attempt to read the configuration file every 10 seconds in non-exclusive read-only mode. The SDK will create or overwrite a file with new logs according to the configuration. This file will not exceed the configured max size and will be overwritten in a circular way.

A log file named as ExecutableName.ProcessId.log (e.g. pwsh.exe.12345.log) will be generated at the specified directory LogDirectory, into which logs are written to.