LoggerEnrichmentOptions.IncludeExceptionMessage Property

Definition

Gets or sets a value indicating whether to include the exception message when an exception is logged.

C#
public bool IncludeExceptionMessage { get; set; }

Property Value

This defaults to false.

Remarks

When both IncludeExceptionMessage and CaptureStackTraces are set to true exception messages are also included in stack traces.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)