<?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">
<targets>
<target name="file" xsi:type="File" fileName="${basedir}/log.txt" />
<target
name="mail" xsi:type="Mail" smtpServer="outbound-mail.test.com" smtpPort="25"
from="test@gmail.com" to="test2@gmail.com"
subject="${longdate} ${machinename}: ${message}"
body="${longdate}|${level:uppercase=true}|${logger}|${callsite}|${message}|${exception}|${stacktrace}"
/>
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="file,mail" />
</rules>
</nlog>
leave a comment