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
namestringThe name of the property.
valueobjectThe value of the property.
destructureObjectsboolIf 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
nameisnull- ArgumentException
When
nameis empty or only contains whitespace
Methods
Enrich(LogEvent, ILogEventPropertyFactory)
Enrich the log event.
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
Parameters
logEventLogEventThe log event to enrich.
propertyFactoryILogEventPropertyFactoryFactory for creating new properties to add to the event.
Exceptions
- ArgumentNullException
When
logEventisnull- ArgumentNullException
When
propertyFactoryisnull