|
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
</configSections>
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="TestSource" switchValue="All">
<listeners>
<add name="nlog" />
</listeners>
</source>
</sources>
<sharedListeners>
<add name="nlog" type="LowLevelDesign.NLog.NLogTraceListener, LowLevelDesign.NLog.Ext" />
</sharedListeners>
</system.diagnostics>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
internalLogToConsole="true" internalLogLevel="Info">
<extensions>
<add prefix="lld" assembly="LowLevelDesign.NLog.Ext" />
</extensions>
<targets>
<target name="file" xsi:type="File" fileName="c:\logs\test.log" deleteOldFileOnStartup="true" layout="${longdate}|${event-context:item=RelatedActivityID}->${lld.activityid}|${processid}(${threadid})|${logger}|${uppercase:${level}}|${message}${onexception:|Exception occurred\:${exception:format=tostring}}" />
<target name="console" xsi:type="ColoredConsole" layout="${longdate}|${lld.activityid}->${event-context:item=RelatedActivityID}|${processid}(${threadid})|${logger}|${uppercase:${level}}|${message}${onexception:|Exception occurred\:${exception:format=tostring}}" />
</targets>
<rules>
<logger name="TestLogger" minlevel="Debug" writeTo="console" />
<logger name="TestLogger" minlevel="Debug" writeTo="file" />
<logger name="TestSource" minlevel="Debug" writeTo="console" />
<logger name="TestSource" minlevel="Debug" writeTo="file" />
</rules>
</nlog>
</configuration>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.