Skip to content

Instantly share code, notes, and snippets.

@masaru-b-cl
Created August 5, 2014 16:52
Show Gist options
  • Save masaru-b-cl/7ac8f8504ebaebab383d to your computer and use it in GitHub Desktop.
Save masaru-b-cl/7ac8f8504ebaebab383d to your computer and use it in GitHub Desktop.
NLogでタブ区切りのログを出力するための構成ファイル
<?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="file" xsi:type="File" fileName="${basedir}/log.txt" encoding="UTF-8">
<!-- タブ区切りのレイアウト -->
<layout xsi:type="CSVLayout" delimiter="Tab">
<!-- ヘッダーは出さない -->
<withHeader>false</withHeader>
<!-- 項目はクォートしない -->
<quoting>Nothing</quoting>
<column layout="${longdate}" />
<column layout="${level}" />
<column layout="${message}" />
</layout>
</target>
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="file" />
</rules>
</nlog>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment