You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously I used to store my layout in a variable and place that layout on the target. This allowed me to setup the defaultLayout once and share it across multiple targets.
e.g.
<!-- Setting the Variable -->
<variablename="defaultLayout"value="${iso8601dateformat}|${level:uppercase=true}|[${logger}]|[Thread-${threadid}]|[Machine-${machinename}]|${message}${onexception:${newline}EXCEPTION OCCURRED\:${exception:tostring:maxInnerExceptionLevel=5:innerFormat=tostring}}" />
<!-- Assigning the layout -->
<targetxsi:type="File"fileName="${logFilePath}trace.txt"layout="${defaultLayout}"maxArchiveFiles="100"archiveNumbering="Sequence"archiveAboveSize="${archiveFileAboveBytes}"archiveFileName="${logFilePath}archive/trace-{#####}.txt" />
I'm now moving my logging to use JsonLayout. Is it still possible to store the layout in a variable and assign it to a target?
If so can you please provide an example of how it can be done?
Thanks,
Lach
The text was updated successfully, but these errors were encountered:
NLog version 4.2.3 - .Net 4.5
Previously I used to store my layout in a variable and place that layout on the target. This allowed me to setup the defaultLayout once and share it across multiple targets.
e.g.
I'm now moving my logging to use JsonLayout. Is it still possible to store the layout in a variable and assign it to a target?
If so can you please provide an example of how it can be done?
Thanks,
Lach
The text was updated successfully, but these errors were encountered: