This repository has been archived by the owner on Jul 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
nlog.config
46 lines (41 loc) · 1.7 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
<?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">
<extensions>
<add assembly="NLog.StructuredLogging.Json" />
</extensions>
<variable name="log_dir" value="${basedir}..\logs" />
<variable name="archive_dir" value="${log_dir}\archive" />
<variable name="human_readable_layout" value="${longdate}|${level}|${logger}|${message}|${onexception:EXCEPTION OCCURRED\:${exception:format=type,message,method,stackTrace:maxInnerExceptionLevel=5:innerFormat=shortType,message,method,stackTrace}}" />
<targets async="true">
<target name="nxlog_json"
fileName="${log_dir}\nxlog\${level:lowercase=true}.log"
encoding="utf-8"
xsi:type="File"
layout="${structuredlogging.json}"
archiveEvery="Hour"
archiveNumbering="Date"
archiveDateFormat="yyyyMMdd-HHmm"
archiveFileName="${archive_dir}\nxlog\{#####}-${level:lowercase=true}.log"
maxArchiveFiles="36"
concurrentWrites="false"
keepFileOpen="false" />
<target name="human_text_file"
fileName="${log_dir}\human-readable\${level:lowercase=true}.log"
encoding="utf-8"
xsi:type="File"
layout="${human_readable_layout}"
archiveEvery="Hour"
archiveNumbering="Date"
archiveDateFormat="yyyyMMdd-HHmm"
archiveFileName="${archive_dir}\human-readable\{#####}-${level:lowercase=true}.log"
maxArchiveFiles="36"
concurrentWrites="false"
keepFileOpen="false" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="nxlog_json" />
<logger name="*" minlevel="Info" writeTo="human_text_file" />
</rules>
</nlog>