Skip to content

Instantly share code, notes, and snippets.

@yoeun
Created August 14, 2012 21:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save yoeun/3353036 to your computer and use it in GitHub Desktop.
Save yoeun/3353036 to your computer and use it in GitHub Desktop.
NLog settings in app.config and web.config files
<?xml version="1.0"?>
<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="default" xsi:type="File"
fileName="C:\logs\app-log.txt"
archiveFileName="C:\logs\archives\app-log.{#}.txt"
archiveEvery="Day"
archiveNumbering="Rolling"
maxArchiveFiles="7" />
<target name="errors" xsi:type="File"
fileName="C:\logs\app-errors.txt"
archiveFileName="C:\logs\archives\app-errors.{#}.txt"
archiveEvery="Day"
archiveNumbering="Rolling"
maxArchiveFiles="7" />
</targets>
<rules>
<logger name="*" writeTo="default" />
<logger name="*" minlevel="Error" writeTo="errors" />
</rules>
</nlog>
</configuration>
@dorChuck
Copy link

Thank you for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment