EDIT 4: \"From\" seems to be a reserved word in NLog. Changing it \"FromID\" worked. this is an awesome way to pass variables to NLog and still keep your code clean !!!! TH
Use MDLC Layout Renderer
MappedDiagnosticsLogicalContext.Set("PropertyName", "PropertyValue"); MappedDiagnosticsLogicalContext.Set("PropertyName2", "AnotherPropertyValue");
In your nlog config:
${mdlc:item=PropertyName} ${mdlc:item=PropertyName2}
https://github.com/NLog/NLog/wiki/MDLC-Layout-Renderer