-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnlog.config
47 lines (42 loc) · 2.62 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?xml version="1.0" encoding="utf-8"?>
<!-- XSD manual extracted from package NLog.Schema: https://www.nuget.org/packages/NLog.Schema-->
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xsi:schemaLocation="NLog NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
internalLogFile="${commonApplicationDataDir}\SharpFM\SharpFM-nlog-internal.log"
internalLogLevel="Error">
<!-- the targets to write to -->
<targets>
<!-- write colorful logs to the console -->
<target name="logconsole" xsi:type="ColoredConsole" enableAnsiOutput="true"
layout="${time}|${uppercase:${level:padding=5}}|${mdlc:item=ScopeName}|${ndlctiming:currentScope=true}|${logger}|${message} ${exception:format=tostring:innerFormat=tostring:maxInnerExceptionLevel=2}"
useDefaultRowHighlightingRules="true">
<highlight-row condition="level == LogLevel.Fatal" foregroundColor="Red" />
<highlight-row condition="level == LogLevel.Error" foregroundColor="Yellow" />
<highlight-row condition="level == LogLevel.Warn" foregroundColor="Magenta" />
<highlight-row condition="level == LogLevel.Info" foregroundColor="Cyan" />
<highlight-row condition="level == LogLevel.Debug" foregroundColor="Green" />
<highlight-row condition="level == LogLevel.Trace" foregroundColor="DarkGray" />
</target>
<!-- write logs to file in app data folder -->
<target xsi:type="File" name="logfile"
fileName="${specialfolder:folder=CommonApplicationData}\SharpFM\Application.log"
archiveFileName="${specialfolder:folder=CommonApplicationData}\SharpFM\Application-{#}.log"
archiveNumbering="Date"
archiveEvery="Day"
archiveDateFormat="yyyy-MM-dd"
maxArchiveFiles="30"
layout="${longdate}|${uppercase:${level:padding=5}}|${mdlc:item=ScopeName}|${ndlctiming:currentScope=true}|${logger}|${message} ${exception:format=tostring:innerFormat=tostring:maxInnerExceptionLevel=2}" />
</targets>
<!-- rules to map from logger name to target -->
<rules>
<!-- write all logs to console -->
<logger name="*" minlevel="Trace" writeTo="logconsole" />
<!-- blackhole Avalonia Trace, Debug, and Info. only allow Warning, Error, Fatal to fall
through to logfile. -->
<logger name="Avalonia.*" minlevel="Trace" maxlevel="Info" final="true" />
<!-- anything remaining here is logged to the logfile that rotates every 30 days. -->
<logger name="*" minlevel="Info" writeTo="logfile" />
</rules>
</nlog>