PostSharpAPI ReferencePost­Sharp.​Patterns.​Diagnostics.​CustomLogging­Property­Options
Open sandboxFocus

LoggingPropertyOptions Class

Specifies the behavior of logging properties (exposed by LogEventData), such as IsRendered, IsInherited or IsBaggage.

Inheritance
System.Object
LoggingPropertyOptions
Namespace: PostSharp.Patterns.Diagnostics.Custom
Assembly: PostSharp.Patterns.Common.dll
Syntax
public sealed class LoggingPropertyOptions : ValueType

Constructors

Name Description
LoggingPropertyOptions(Boolean, Boolean, Boolean, Boolean, IFormatter)

Initializes a new LoggingPropertyOptions.

Properties

Name Description
Formatter

Gets the formatter to be used to render the property value.

IsBaggage

Determines whether the property is cross-process. The default value is false. When this property is set to true, IsInherited is automatically set to true.

IsIgnored

Determines whether this property must be ignored by the VisitProperties<TVisitorState>(Object, ILoggingPropertyVisitor<TVisitorState>, ref TVisitorState, in LoggingPropertyVisitorOptions) method. This value is typically only returned by GetPropertyOptions(String) to say that a property of the raw CLR object must not be exposed as a logging property.

IsInherited

Determines whether the property is inherited from the parent activity to children activities and messages. The default value is true. When this property is set to false, IsBaggage is automatically set to false.

IsRendered

Determines whether the property will be included in the log message. The default value is false, then the property is only available as an additional property, if this is supported by the backend.

Methods

Name Description
WithFormatter(IFormatter)

Returns a copy of the current LoggingPropertyOptions but with a different value of the Formatter property.

WithIsBaggage(Boolean)

Returns a copy of the current LoggingPropertyOptions but with a different value of the IsBaggage property.

WithIsIgnored(Boolean)

Returns a copy of the current LoggingPropertyOptions but with a different value of the IsIgnored property.

WithIsInherited(Boolean)

Returns a copy of the current LoggingPropertyOptions but with a different value of the IsInherited property.

WithIsRendered(Boolean)

Returns a copy of the current LoggingPropertyOptions but with a different value of the IsRendered property.