Skip to content

Instantly share code, notes, and snippets.

@Cl3MM
Last active March 3, 2017 10:10
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 Cl3MM/aae88b59007b2b7e2ae42f8e90b0ffc5 to your computer and use it in GitHub Desktop.
Save Cl3MM/aae88b59007b2b7e2ae42f8e90b0ffc5 to your computer and use it in GitHub Desktop.
NLog.config: redirect Hangfire logs
<?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"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
<targets>
<target xsi:type="File" name="f"
fileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message} (${callsite} ${callsite-linenumber})" />
<target name="hangfire" xsi:type="File"
fileName="${basedir}/logs/hangfire/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}">
</target>
</targets>
<rules>
<logger name="Hangfire.*" minlevel="Debug" writeTo="hangfire" final="true" />
<logger name="*" minlevel="Debug" writeTo="f" />
</rules>
</nlog>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment