Class PropertyEnricher
Adds a new property enricher to the log event.
public class PropertyEnricher : ILogEventEnricher
- Inheritance
-
PropertyEnricher
- Implements
- Inherited Members
Constructors
PropertyEnricher(string, object?, bool)
Create a new property enricher.
public PropertyEnricher(string name, object? value, bool destructureObjects = false)
Parameters
name
stringThe name of the property.
value
objectThe value of the property.
destructureObjects
boolIf true, and the value is a non-primitive, non-array type, then the value will be converted to a structure; otherwise, unknown types will be converted to scalars, which are generally stored as strings.
Exceptions
- ArgumentNullException
When
name
isnull
- ArgumentException
When
name
is empty or only contains whitespace
Methods
Enrich(LogEvent, ILogEventPropertyFactory)
Enrich the log event.
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
Parameters
logEvent
LogEventThe log event to enrich.
propertyFactory
ILogEventPropertyFactoryFactory for creating new properties to add to the event.
Exceptions
- ArgumentNullException
When
logEvent
isnull
- ArgumentNullException
When
propertyFactory
isnull