NLog.Targets.TargetWithContext
Represents target that supports context capture of ScopeContext Properties + Nested-states
Gets the array of custom attributes to be passed into the logevent context
List of property names to exclude when IncludeEventProperties is true
Gets or sets a value indicating whether to include call site (class and method name) in the LogEventInfo
Gets or sets a value indicating whether to include source info (file name and line number) in the LogEventInfo
Gets or sets whether to include the contents of the Properties dictionary.
Gets or sets a value indicating whether to include contents of the GlobalDiagnosticsContext dictionary
Obsolete and replaced by IncludeScopeProperties with NLog v5.
Gets or sets whether to include the contents of the MappedDiagnosticsContext-dictionary.
Obsolete and replaced by IncludeScopeProperties with NLog v5.
Gets or sets whether to include the contents of the MappedDiagnosticsLogicalContext-properties.
Obsolete and replaced by IncludeScopeNested with NLog v5.
Gets or sets whether to include the contents of the NestedDiagnosticsContext-stack.
Obsolete and replaced by IncludeScopeNested with NLog v5.
Gets or sets whether to include the contents of the NestedDiagnosticsLogicalContext-stack.
Gets or sets whether to include the contents of the ScopeContext nested-state-stack.
Gets or sets whether to include the contents of the ScopeContext properties-dictionary.
protected TargetWithContext()
Constructor
protected virtual IDictionary<string, object> CaptureContextGdc(LogEventInfo logEvent, IDictionary<string, object> contextProperties)
Takes snapshot of GlobalDiagnosticsContext for the LogEventInfo
Takes snapshot of nested states from ScopeContext for the LogEventInfo
protected virtual IDictionary<string, object> CaptureScopeContextProperties(LogEventInfo logEvent, IDictionary<string, object> contextProperties)
Takes snapshot of ScopeContext dictionary for the LogEventInfo
protected virtual string GenerateUniqueItemName(LogEventInfo logEvent, string itemName, object itemValue, IDictionary<string, object> combinedProperties)
Generates a new unique name, when duplicate names are detected
Creates combined dictionary of all configured properties for logEvent
protected IDictionary<string, object> GetAllProperties(LogEventInfo logEvent, IDictionary<string, object> combinedProperties)
Creates combined dictionary of all configured properties for logEvent
Returns the captured snapshot of MappedDiagnosticsLogicalContext for the LogEventInfo
Returns the captured snapshot of NestedDiagnosticsLogicalContext for the LogEventInfo
Checks if any context properties, and if any returns them as a single dictionary
protected IDictionary<string, object> GetContextProperties(LogEventInfo logEvent, IDictionary<string, object> combinedProperties)
Checks if any context properties, and if any returns them as a single dictionary
Returns the captured snapshot of nested states from ScopeContext for the LogEventInfo
Returns the captured snapshot of ScopeContext dictionary for the LogEventInfo
protected virtual bool SerializeItemValue(LogEventInfo logEvent, string name, object value, out object serializedValue)
Take snapshot of a single object value
protected virtual bool SerializeScopeContextNestedState(LogEventInfo logEvent, object value, out object serializedValue)
Take snapshot of a single object value from ScopeContext nested states
protected virtual bool SerializeScopeContextProperty(LogEventInfo logEvent, string name, object value, out object serializedValue)
Take snapshot of a single object value from ScopeContext dictionary
Check if logevent has properties (or context properties)