-
Notifications
You must be signed in to change notification settings - Fork 0
/
NLog.config
21 lines (19 loc) · 1.23 KB
/
NLog.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?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="main" xsi:type="File" fileName="logs/${logger}/${shortdate}.txt"
layout="${longdate}|${level:uppercase=true}|${message}${when:when=length('${exception}') > 0:inner=${newline}}${exception:format=tostring}"/>
<target name="console" xsi:type="ColoredConsole" useDefaultRowHighlightingRules="false" layout="${longdate}|${level:uppercase=true}|${message} ${when:when=length('${exception}') > 0:inner=-} ${exception:format=shorttype,message}">
<highlight-row condition="level == LogLevel.Debug" foregroundColor="DarkGray" />
<highlight-row condition="level == LogLevel.Info" foregroundColor="Gray" />
<highlight-row condition="level == LogLevel.Warn" foregroundColor="Yellow" />
<highlight-row condition="level == LogLevel.Error" foregroundColor="Red" />
<highlight-row condition="level == LogLevel.Fatal" foregroundColor="Red" backgroundColor="White" />
</target>
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="main" />
<logger name="*" minlevel="Info" writeTo="console" />
</rules>
</nlog>