I'm using NLog 4.2.2.
Is there a way to factorize layouts common to multiple targets, maybe with variables?
I've tried this:
<variable name="messageLayout" value="${longdate:universalTime=True}Z..."/>
<target name="console" xsi:type="ColoredConsole" layout="${messageLayout}"/>
<target name="messagesLogFile" xsi:type="File" layout="${messageLayout}"/>
Unfortunately this triggers the following exception at startup:
An unhandled exception of type 'System.TypeInitializationException' occurred in Microsoft.VisualStudio.HostingProcess.Utilities.dll
NLog's documentation is very sparse when it comes to variables. Any clue?