Open sandboxFocus

Struct LogEventData

Specifies the properties of a log event (such as a message, an activity opening or an activity closing). Properties are typically passed in user code as an instance of an anonymous type. Any object can be provided. The properties of the message then stem from the properties of the CLR object. To change the logic that maps the CLR object to the list of property, you can specify a LogEventMetadata.

Implements
Namespace: Flashtrace.Records
Assembly: Flashtrace.dll
Syntax
public readonly struct LogEventData : IEquatable<LogEventData>

Properties

Name Description
Data

Gets the raw CLR object. It must be interpreted using the Metadata property.

HasInheritedProperty
Metadata

Gets the LogEventMetadata, which exposes the Data as a visitable set of name-value properties.

Methods

Name Description
Create(object?)

Creates a new LogEventData and uses the default LogEventMetadata for the run-time type of the specified object.

Create(object?, LogEventMetadata?)

Creates a new LogEventData and specifies a LogEventMetadata.

Create<T>(T?)

Creates a new LogEventData and uses the default LogEventMetadata for the build-time type of the specified object. This overload is faster than the non-generic one.

Equals(LogEventData)
Equals(object?)
GetExpressionModel<T>()
GetHashCode()
ToDictionary()

Returns a dictionary containing all properties contained in the current LogEventData.

ToString()
VisitProperties<TVisitorState>(ILoggingPropertyVisitor<TVisitorState>, ref TVisitorState, in LoggingPropertyVisitorOptions)

Invokes an action for each property in the current LogEventData.

WithAdditionalProperty<T>(string, T, in LoggingPropertyOptions)

Returns a LogEventData that augments the current one with an additional property, but does not change the expression model.

Operators

Name Description
operator ==(LogEventData, LogEventData)

Determines whether two instances of the LogEventData type are equal.

operator !=(LogEventData, LogEventData)

Determines whether two instances of the LogEventData type are different.