-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathNLog.config
33 lines (30 loc) · 1.56 KB
/
NLog.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?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 async="true">
<target xsi:type="ColoredConsole"
name ="console"
useDefaultRowHighlightingRules ="true"
layout="${date:format=HH\:mm\:ss} ${logger:padding=-16:fixedLength=true} ${level:padding=-5:fixedLength=true} ${message} ${onexception:inner=${exception:format=message}}" />
<!--layout="${date:format=HH\:mm\:ss} ${logger:padding=-14:fixedLength=true} ${level:padding=-5:fixedLength=true} ${message} ${onexception:inner=${exception:format=message}}" />-->
<!-- File -->
<target name="file" xsi:type="File" fileName="${basedir}/logs/${logger}_${shortdate}.log">
<layout xsi:type="CsvLayout" delimiter="Tab">
<withHeader>false</withHeader>
<column name="date" layout="${date:format=HH\:mm\:ss}" />
<!-- <column name="logger" layout="${logger}" /> -->
<!-- included in fileName -->
<column name="level" layout="${level}" />
<column name="message" layout="${message}${onexception:inner=${newline}${exception:format=tostring}}" />
</layout>
</target>
</targets>
<rules>
<logger name="*" writeTo="console" />
<logger name="*" minlevel="Warn" writeTo="file" />
</rules>
</nlog>