-
Notifications
You must be signed in to change notification settings - Fork 0
/
NLog.config
58 lines (41 loc) · 2.59 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
48
49
50
51
52
53
54
55
56
57
58
<?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">
<!-- the targets to write to -->
<targets>
<!--Console-->
<target name="logconsole" xsi:type="Console" />
<!--Application Log File-->
<target xsi:type="File" name="application-file" fileName="logs\application-${shortdate}.log"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />
<!--Agent Log File-->
<target xsi:type="File" name="agent-file" fileName="logs\agent-${shortdate}.log"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />
<!--Agent Validation Log File-->
<target xsi:type="File" name="agent-validation-file" fileName="logs\agent-validation-${shortdate}.log"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />
<!--Module Log File-->
<target xsi:type="File" name="module-file" fileName="logs\${logger}-${shortdate}.log"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />
<!--Processor Log File-->
<target xsi:type="File" name="processor-file" fileName="logs\${logger}-${shortdate}.log"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />
</targets>
<!-- rules to map from logger name to target -->
<rules>
<!--Write to Console-->
<logger name="*" minlevel="Info" writeTo="logconsole" />
<!--Application Logger-->
<logger name="application-logger" minlevel="Warning" writeTo="application-file" final="true" />
<!--Agent Logger-->
<logger name="agent-logger" minlevel="Warning" writeTo="agent-file" final="true" />
<!--Agent Validation Logger (Used to log Data Validation Errors)-->
<logger name="agent-validation-logger" minlevel="Warning" writeTo="agent-validation-file" final="true" />
<!--Module Logger-->
<logger name="modules.*" minlevel="Warning" writeTo="module-file" final="true" />
<!--Processor Logger-->
<logger name="processors.*" minlevel="Warning" writeTo="processor-file" final="true" />
<!--Skip non-critical Microsoft logs and so log only own logs (BlackHole) -->
<logger name="Microsoft.*" maxlevel="Warning" final="true" />
<logger name="System.Net.Http.*" maxlevel="Warning" final="true" />
</rules>
</nlog>