Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<nlog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
throwExceptions="false">
<targets>
<!-- size in bytes: 10485760 = 10 MB - set to 5 for most -->
<!-- master/all/combined log file -->
<target name="asyncAllTarget"
xsi:type="AsyncWrapper"
queueLimit="10000"
timeToSleepBetweenBatches="10"
batchSize="500"
overflowAction="Block">
<target name="allTarget"
xsi:type="File"
fileName="${basedir}/logs/log-all.txt"
layout="${time}|${level:uppercase=true}|${threadid}|${logger}|${message}"
archiveAboveSize="10485760"
archiveNumbering="Sequence"
archiveFileName="${basedir}/logs/archive/log-all.{#####}.txt"
maxArchiveFiles="3"
keepFileOpen="false"
deleteOldFileOnStartup="true" />
</target>
<!-- logs scheduling/job/quartz related separately -->
<target name="scheduleTarget"
xsi:type="File"
fileName="${basedir}/logs/log-schedule.txt"
layout="${time}|${level:uppercase=true}|${threadid}|${logger}|${message}"
archiveAboveSize="5242880"
archiveNumbering="Sequence"
archiveFileName="${basedir}/logs/archive/log-schedule.{#####}.txt"
maxArchiveFiles="3"
keepFileOpen="false"
deleteOldFileOnStartup="true" />
<!-- logs resume batch processing results -->
<target name="resumeBatchTarget"
xsi:type="File"
fileName="${basedir}/logs/log-resume-batch.txt"
layout="${time}|${level:uppercase=true}|${threadid}|${logger}|${message}"
archiveAboveSize="5242880"
archiveNumbering="Sequence"
archiveFileName="${basedir}/logs/archive/log-resume-batch.{#####}.txt"
maxArchiveFiles="3"
keepFileOpen="false"
deleteOldFileOnStartup="true" />
<!-- logs XML file processing related -->
<target name="asyncXmlTarget"
xsi:type="AsyncWrapper"
queueLimit="10000"
timeToSleepBetweenBatches="10"
batchSize="500"
overflowAction="Block">
<target name="xmlTarget"
xsi:type="File"
fileName="${basedir}/logs/log-xml.txt"
layout="${time}|${level:uppercase=true}|${threadid}|${logger}|${message}"
archiveAboveSize="5242880"
archiveNumbering="Sequence"
archiveFileName="${basedir}/logs/archive/log-xml.{#####}.txt"
maxArchiveFiles="3"
keepFileOpen="false"
deleteOldFileOnStartup="true" />
</target>
<!-- logs issues and warnings separately -->
<target name="asyncIssueTarget"
xsi:type="AsyncWrapper"
queueLimit="10000"
timeToSleepBetweenBatches="10"
batchSize="500"
overflowAction="Block">
<target name="issueTarget"
xsi:type="File"
fileName="${basedir}/logs/log-issues.txt"
layout="${time}|${level:uppercase=true}|${threadid}|${logger}|${message}"
archiveAboveSize="5242880"
archiveNumbering="Sequence"
archiveFileName="${basedir}/logs/archive/log-issues.{#####}.txt"
maxArchiveFiles="3"
keepFileOpen="false"
deleteOldFileOnStartup="true" />
</target>
<target name="asyncDebugTarget"
xsi:type="AsyncWrapper"
queueLimit="10000"
timeToSleepBetweenBatches="10"
batchSize="500"
overflowAction="Block">
<target name="debugTarget"
xsi:type="Debugger"
layout="${time}|${level:uppercase=true}|${threadid}|${logger}|${message}" />
</target>
</targets>
<rules>
<!-- Levels: Off, Trace, Debug, Info, Warn, Error, Fatal -->
<logger name="*" minlevel="Info" writeTo="asyncAllTarget"/>
<logger name="*" minlevel="Warn" writeTo="asyncIssueTarget"/>
<logger name="MonsterPrivateResumeUpload.Jobs.*" minlevel="Info" writeTo="scheduleTarget"/>
<logger name="Quartz.*" minlevel="Info" writeTo="scheduleTarget"/>
<logger name="MonsterPrivateResumeUpload.ResumeBatchProcessor" minlevel="Info" writeTo="resumeBatchTarget"/>
<logger name="MonsterPrivateResumeUpload.Xml.*" minlevel="Info" writeTo="asyncXmlTarget"/>
</rules>
</nlog>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment