<?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"
      autoReload="true">

  <targets>
    <target name="text" xsi:type="File" autoFlush="true" fileName="${basedir}/DeviceLogs/text/${shortdate}.log" encoding="UTF-8"
        layout="${longdate}|${level:uppercase=true}|${logger}(${threadid})|${message} ${exception:format=tostring}" />

    <target name="xml" xsi:type="File" autoFlush="true" fileName="${basedir}/DeviceLogs/xml/${shortdate}.xml" encoding="UTF-8">
      <layout xsi:type="SimpleLayout">
        <text>
&lt;EventLog&gt;&#xD;
  &lt;LogDateTime&gt;${longdate}&lt;/LogDateTime&gt;&#xD;
  &lt;Level&gt;${level:uppercase=true}&lt;/Level&gt;&#xD;
  &lt;LoggerName&gt;${logger}&lt;/LoggerName&gt;&#xD;
  &lt;ThreadId&gt;${threadid}&lt;/ThreadId&gt;&#xD;
  &lt;Message&gt;${message}&lt;/Message&gt;&#xD;
  &lt;Exception&gt;${exception:format=tostring}&lt;/Exception&gt;&#xD;
&lt;/EventLog&gt;</text>
      </layout>
    </target>
  </targets>

  <rules>

    <logger name="*" writeTo="text" minlevel="Trace"/>
    <logger name="*" writeTo="xml" minlevel="Trace"/>

  </rules>
</nlog>