I'm not sure was it intended to work in the initial design but doesn't in the following config file.
Buffering only works when declared over each target. But if network share becomes unreachable then all the buffer data will be lost and FallbackTarget switches to the next one.
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="
http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" internalLogFile="C:\Temp\nlog.log" throwExceptions="true" internalLogLevel="Trace">
<variable name="FCUCopyResultLogPath" value="${gdc:FCUCopyResultLogPath}"/>
<variable name ="FCUCopyResultLogName" value="${gdc:FCUCopyResultLogName}"/>
<variable name="SizeThreshold" value="524288"/>
<variable name ="MaxArchiveFiles" value="1000"/>
<targets async="false">
<wrapper-target xsi:type="BufferingWrapper" bufferSize="1000" name="testBuffer">
<compound-target xsi:type="FallbackGroup" name="FallbackGroup" returnToFirstOnSuccess="false">
<target name="primaryFile"
xsi:type="File"
fileName="${FCUCopyResultLogPath}"
networkWrites="true"
concurrentWrites="false"
encoding="utf-16"
archiveAboveSize="${SizeThreshold}"
deleteOldFileOnStartup="true"
maxArchiveFiles="${MaxArchiveFiles}">
<layout xsi:type="CSVLayout" delimiter="Tab">
<column name="time" layout="${longdate}" />
<column name="message" layout="${message}" />
<column name="logger" layout="${logger}"/>
<column name="level" layout="${level}"/>
</layout>
</target>
<target name="secureFile"
xsi:type="File"
fileName="${specialfolder:folder=DesktopDirectory:upperCase=true}\${FCUCopyResultLogName}"
networkWrites="false"
concurrentWrites="false"
encoding="utf-16"
archiveAboveSize="${SizeThreshold}"
deleteOldFileOnStartup="true"
maxArchiveFiles="${MaxArchiveFiles}">
<layout xsi:type="CSVLayout" delimiter="Tab">
<column name="time" layout="${longdate}" />
<column name="message" layout="${message}" />
<column name="logger" layout="${logger}"/>
<column name="level" layout="${level}"/>
</layout>
</target>
</compound-target>
</wrapper-target>
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="testBuffer" />
</rules>
</nlog>