Documentation says:
Sometimes we require ALL targets to be wrapped in the same way, for example to add buffering and/or retrying. NLog provides
<default-wrapper />syntax for that. You simply put this element in the<targets />section and all your targets will be automatically wrapped with the specified wrapper.
It also provides the following example:
<nlog>
<targets>
<default-wrapper xsi:type="BufferingWrapper" bufferSize="100"/>
<target name="f1" xsi:type="File" fileName="f1.txt"/>
<target name="f2" xsi:type="File" fileName="f2.txt"/>
</targets>
<targets>
<default-wrapper xsi:type="AsyncWrapper">
<wrapper-target xsi:type="RetryingWrapper"/>
</default-wrapper>
<target name="n1" xsi:type="Network" address="tcp://localhost:4001"/>
<target name="n2" xsi:type="Network" address="tcp://localhost:4002"/>
<target name="n3" xsi:type="Network" address="tcp://localhost:4003"/>
</targets>
</nlog>
So, <default-wrapper /> element should be a child of <targets> to be applied to each <target> within the same parent.
On the other hand, Extended Json NLog Config Example uses default-wrapper on the same level as targets element:
"default-wrapper": {
"type": "AsyncWrapper",
"overflowAction": "Block"
},
"targets": {
So, I have the following questions:
- Is the Extended Json NLog Config Example correct?
- Will all targets from
targetselement be wrapped with thedefault-wrapper, placed out of thetargets? - What if there are
default-wrapperwithintargetsanddefault-wrapperout oftargetsin the same configuration file?