Skip to content

Instantly share code, notes, and snippets.

@ichiroku11
Created July 5, 2013 14:40
Show Gist options
  • Select an option

  • Save ichiroku11/5935000 to your computer and use it in GitHub Desktop.

Select an option

Save ichiroku11/5935000 to your computer and use it in GitHub Desktop.
NLog.configのサンプル 変数定義とファイルを日付でローリング
<?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">
<variable
name="layout"
value="${longdate}|${level}|${message}" />
<targets>
<target
name="file" xsi:type="File" encoding="utf-8"
fileName="${basedir}/Log/${shortdate}.log"
layout="${layout}" />
<target
name="console" xsi:type="Console"
layout="${layout}" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="file" />
<logger name="*" minlevel="Info" writeTo="console" />
</rules>
</nlog>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment