-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNLog.config
More file actions
67 lines (57 loc) · 2.95 KB
/
Copy pathNLog.config
File metadata and controls
67 lines (57 loc) · 2.95 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?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"
internalLogLevel="Warn"
internalLogFile="${basedir}/logs/nlog-internal.log">
<targets async="true">
<!-- Rotating file: roll every 10 MB, keep 30 archives, archive daily -->
<target xsi:type="File"
name="rollingFile"
fileName="${basedir}/logs/WinSerialMon.log"
layout="${longdate}|${level:uppercase=true}|${logger}|${message}${onexception:inner= |EX: ${exception:format=tostring}}"
archiveFileName="${basedir}/logs/archives/WinSerialMon.{#}.log"
archiveNumbering="DateAndSequence"
archiveDateFormat="yyyy-MM-dd"
archiveAboveSize="10485760"
archiveEvery="Day"
maxArchiveFiles="30"
concurrentWrites="true"
keepFileOpen="true"
encoding="utf-8" />
<!-- Dedicated trace file: verbose per-event detail, roll every 50 MB, keep 10 archives -->
<target xsi:type="File"
name="traceFile"
fileName="${basedir}/logs/WinSerialMon.trace.log"
layout="${longdate}|${level:uppercase=true}|${logger}|pid=${processid}|tid=${threadid}|${message}${onexception:inner= |EX: ${exception:format=tostring}}"
archiveFileName="${basedir}/logs/archives/WinSerialMon.trace.{#}.log"
archiveNumbering="DateAndSequence"
archiveDateFormat="yyyy-MM-dd"
archiveAboveSize="52428800"
archiveEvery="Day"
maxArchiveFiles="10"
concurrentWrites="true"
keepFileOpen="true"
encoding="utf-8" />
<!-- Console target for development -->
<target xsi:type="ColoredConsole"
name="console"
layout="${time}|${level:uppercase=true}|${logger:shortName=true}|${message}${onexception:inner= |EX: ${exception:format=message}}" >
<highlight-row condition="level == LogLevel.Trace" foregroundColor="DarkGray" />
<highlight-row condition="level == LogLevel.Error" foregroundColor="Red" />
<highlight-row condition="level == LogLevel.Warn" foregroundColor="Yellow" />
<highlight-row condition="level == LogLevel.Info" foregroundColor="Cyan" />
<highlight-row condition="level == LogLevel.Debug" foregroundColor="Gray" />
</target>
</targets>
<rules>
<!-- Suppress verbose NLog internals -->
<logger name="Microsoft.*" maxLevel="Info" final="true" />
<!-- WinSerialMon Trace-level events go to the dedicated trace file only -->
<logger name="WinSerialMon.*" minlevel="Trace" maxlevel="Trace" writeTo="traceFile" />
<!-- WinSerialMon Debug+ events go to rolling file and console -->
<logger name="WinSerialMon.*" minlevel="Debug" writeTo="rollingFile,console" />
<!-- Catch-all -->
<logger name="*" minlevel="Info" writeTo="rollingFile,console" />
</rules>
</nlog>