Skip to content

Instantly share code, notes, and snippets.

@nickheppleston
Created October 27, 2014 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickheppleston/9de43d979a8891aabf12 to your computer and use it in GitHub Desktop.
Save nickheppleston/9de43d979a8891aabf12 to your computer and use it in GitHub Desktop.
NLog App.Config Showing Archive File Rotation
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
</configSections>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="MessageWorker" xsi:type="File" fileName="logs\MessageWorker_Current.log" layout="${longdate} ${level:uppercase=true:padding=5} ${processid} ${message}" archiveFileName="logs\MessageWorker_{#}.txt" archiveEvery="Day" archiveNumbering="Date" archiveDateFormat="yyyy-MM-dd_HH-mm-ss" maxArchiveFiles="14" concurrentWrites="false" keepFileOpen="false" encoding="iso-8859-2" />
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="MessageWorker" />
</rules>
</nlog>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment