Click or drag to resize

LoggerWithProperty Method

Creates new logger that automatically appends the specified property to all log events (without changing current logger) With Properties property, all properties can be enumerated.

Namespace:  NLog
Assembly:  NLog (in NLog.dll) Version: 6.0.0+cfb73701cda54e2410b006f649f072e90daef707
Syntax
public Logger WithProperty(
	string propertyKey,
	Object? propertyValue
)

Parameters

propertyKey
Type: SystemString
Property Name
propertyValue
Type: SystemObject
Property Value

Return Value

Type: Logger
New Logger object that automatically appends specified property
See Also