Skip to content

Instantly share code, notes, and snippets.

@DTTerastar
Created October 5, 2013 15:51
Show Gist options
  • Save DTTerastar/6842546 to your computer and use it in GitHub Desktop.
Save DTTerastar/6842546 to your computer and use it in GitHub Desktop.
Nlog to Papertrail
<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">
<extensions>
<add assembly="NLog.Targets.Syslog" />
</extensions>
<targets async="true">
<target xsi:type="File" name="f" fileName="${basedir}/App_Data/logs/${shortdate}.log" layout="${longdate} ${uppercase:${level}} ${message}" />
<target name="papertrail" type="Syslog" syslogserver="logs.papertrailapp.com" port="*fillin*" facility="Local7" layout="${uppercase:${level}} ${message} ${exception}"/>
</targets>
<rules>
<logger name="*" minLevel="Trace" appendTo="papertrail"/>
<logger name="*" minlevel="Trace" writeTo="f" />
</rules>
</nlog>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment