TargetWithContext
Represents target that supports context capture using MDLC, MDC, NDLC and NDC
Gets the array of custom attributes to be passed into the logevent context
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 a value indicating whether to include contents of the GlobalDiagnosticsContext dictionary
protected TargetWithContext()
Constructor
protected virtual IDictionary<string, object> CaptureContextGdc(LogEventInfo logEvent, IDictionary<string, object> contextProperties)
Takes snapshot of GlobalDiagnosticsContext for the LogEventInfo
protected virtual IDictionary<string, object> CaptureContextMdc(LogEventInfo logEvent, IDictionary<string, object> contextProperties)
Takes snapshot of MappedDiagnosticsContext for the LogEventInfo
protected virtual IDictionary<string, object> CaptureContextMdlc(LogEventInfo logEvent, IDictionary<string, object> contextProperties)
Takes snapshot of MappedDiagnosticsLogicalContext for the LogEventInfo
Takes snapshot of NestedDiagnosticsContext for the LogEventInfo
Takes snapshot of NestedDiagnosticsLogicalContext 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 MappedDiagnosticsContext for the LogEventInfo
Returns the captured snapshot of MappedDiagnosticsLogicalContext for the LogEventInfo
Returns the captured snapshot of NestedDiagnosticsContext 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
protected virtual bool SerializeItemValue(LogEventInfo logEvent, string name, object value, out object serializedValue)
Take snapshot of a single object value
protected virtual bool SerializeMdcItem(LogEventInfo logEvent, string name, object value, out object serializedValue)
Take snapshot of a single object value from MappedDiagnosticsContext
protected virtual bool SerializeMdlcItem(LogEventInfo logEvent, string name, object value, out object serializedValue)
Take snapshot of a single object value from MappedDiagnosticsLogicalContext
protected virtual bool SerializeNdcItem(LogEventInfo logEvent, object value, out object serializedValue)
Take snapshot of a single object value from NestedDiagnosticsContext
protected virtual bool SerializeNdlcItem(LogEventInfo logEvent, object value, out object serializedValue)
Take snapshot of a single object value from NestedDiagnosticsLogicalContext
Check if logevent has properties (or context properties)