Skip to content

Instantly share code, notes, and snippets.

@abelevtsov
Created July 6, 2016 12:24
Show Gist options
  • Save abelevtsov/f0fa0745553b252155e576d7fbc50938 to your computer and use it in GitHub Desktop.
Save abelevtsov/f0fa0745553b252155e576d7fbc50938 to your computer and use it in GitHub Desktop.
<?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" >
<variable name="projectName" value="RARE" />
<targets async="true">
<target name="file"
xsi:type="File"
fileName="C:\Logs\${projectName}\${projectName}.log"
archiveAboveSize="10485760"
archiveNumbering="Rolling"
encoding="utf-8"
maxArchiveFiles="20"
layout="${date:format=yyyy-MM-dd HH\:mm\:ss.fff} [${threadid}] ${level:uppercase=true:padding=-5} (${callsite:className=true:fileName=false:includeSourcePath=false:methodName=true:cleanNamesOfAnonymousDelegates=false:skipFrames=0}) - ${message} ${exception:innerFormat=ToString:maxInnerExceptionLevel=10:innerExceptionSeparator=newline:separator=newline:format=ToString}" />
<target name="console" xsi:type="Console" />
<target xsi:type="Mail"
name="mail"
body="${date:format=yyyy-MM-dd HH\:mm\:ss.fff} [${threadid}] ${level:uppercase=true:padding=-5} (${callsite:className=true:fileName=false:includeSourcePath=false:methodName=true:cleanNamesOfAnonymousDelegates=false:skipFrames=0}) - ${message} ${exception:innerFormat=ToString:maxInnerExceptionLevel=10:innerExceptionSeparator=newline:separator=newline:format=ToString}"
html="true"
addNewLines="true"
replaceNewlineWithBrTagInHtml="true"
encoding="utf-8"
subject="${projectName} error on ${machinename}"
to="abelevtsov@raresoft.ru"
from="jobscheduler@raresoft.ru"
enableSsl="false"
smtpServer="rare-21"
smtpPort="25"
useSystemNetMailSettings="false"
timeout="180" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="file" />
<logger name="*" minlevel="Debug" writeTo="console" />
<logger name="*" minlevel="Error" writeTo="mail" />
<logger name="*" minlevel="Fatal" writeTo="mail" />
</rules>
</nlog>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment