Log event property data.
Platforms Supported: All
${event-properties:item=MyValue}
Note that ${event-properties} syntax replaces the now deprecated ${event-context}
syntax.
In your C# code, create an event and add an element to the Properties
dictionary (or the deprecated Context
dictionary):
... Logger log = LogManager.GetCurrentClassLogger(); LogEventInfo theEvent = new LogEventInfo(LogLevel.Debug, "", "Pass my custom value"); theEvent.Properties["MyValue"] = "My custom string"; // deprecated theEvent.Context["TheAnswer"] = 42; log.Log(theEvent); ...
And in your NLog.config
file:
${event-properties:item=MyValue} -- renders "My custom string"
${event-properties:item=TheAnswer} -- renders "42"
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4