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 async="true">
<!-- size in bytes: 10485760 = 10 MB - set to 5 for most -->
<!-- master/all/combined log file -->
<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" />
<!-- 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="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" />
<!-- logs issues and warnings separately -->
<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" />
</targets>
<rules>
<!-- Levels: Off, Trace, Debug, Info, Warn, Error, Fatal -->
<logger name="*" minlevel="Warn" writeTo="issueTarget" />
<logger name="MonsterPrivateResumeUpload.Jobs.*" minlevel="Warn" writeTo="scheduleTarget" />
<logger name="Quartz.*" minlevel="Info" writeTo="scheduleTarget" />
<logger name="MonsterPrivateResumeUpload.ResumeBatchProcessor" minlevel="Warn" writeTo="resumeBatchTarget" />
<logger name="MonsterPrivateResumeUpload.Xml.*" minlevel="Warn" writeTo="xmlTarget" />
</rules>
</nlog>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment