-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnlog.config
94 lines (93 loc) · 8.43 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
internalLogFile="C:\Temp\Log\NLogPerformance_Internal.txt" internalLogLevel="Warn" internalLogToConsole="true" throwConfigExceptions="true"
>
<targets>
<target name="NullWithoutFormat" type="Null" formatMessage="false" OptimizeBufferReuse="true" />
<target name="NullWithSimpleFormat" type="Null" formatMessage="true" layout="${time:invariant=true}${message}${exception:format=tostring}" OptimizeBufferReuse="true" />
<target name="NullWithFullFormat" type="Null" formatMessage="true" layout="${longdate} [${threadid}] ${level:uppercase=true} ${logger} - ${message}${exception:format=tostring}" OptimizeBufferReuse="true" />
<target name="AsyncFile" type="AsyncWrapper" batchSize="500" overflowAction="Block" timeToSleepBetweenBatches="0">
<target name="SyncFile" type="File" fileName="C:\Temp\Log\NLogPerformance-${date:format=yyyy}.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false" layout="${longdate} [${threadid}] ${level:uppercase=true} ${logger} - ${message}${exception:format=tostring}" />
</target>
<target name="AsyncFilePerf" type="AsyncWrapper" batchSize="500" overflowAction="Block" timeToSleepBetweenBatches="0">
<target name="SyncFilePerf" type="File" fileName="C:\Temp\Log\NLogPerformancePerf.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false" layout="${message}" />
</target>
<target name="AsyncFilePerfArchive" type="AsyncWrapper" batchSize="500" overflowAction="Block" timeToSleepBetweenBatches="0">
<target name="SyncFilePerfArchive" type="File" fileName="C:\Temp\Log\NLogPerformanceArchivePerf.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false" layout="${message}" ArchiveAboveSize="100000000000" MaxArchiveFiles="1000" ArchiveEvery="Year" ArchiveNumbering="Date" />
</target>
<target name="AsyncFileSimple" type="AsyncWrapper" batchSize="500" overflowAction="Block" timeToSleepBetweenBatches="0">
<target name="SyncFileSimple" type="File" fileName="C:\Temp\Log\NLogPerformanceSimple.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false" layout="${longdate} ${level:uppercase=true} ${logger} - ${message}${exception:format=tostring}" />
</target>
<target name="AsyncFileJson" type="AsyncWrapper" batchSize="500" overflowAction="Block" timeToSleepBetweenBatches="0">
<target name="SyncFileJson" type="File" fileName="C:\Temp\Log\NLogPerformanceJson.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false">
<layout type="JsonLayout" includeAllProperties="true" MaxRecursionLimit="10">
<attribute name="t" layout="${longdate}" encode="false" />
<attribute name="l" layout="${level}" encode="false" />
<attribute name="m" layout="${message:raw=true}" />
</layout>
</target>
</target>
<target name="AsyncFileCsv" type="AsyncWrapper" timeToSleepBetweenBatches="0" overflowAction="Block">
<target name="SyncFileCsv" type="File" fileName="C:\Temp\Log\NLogPerformanceCsv.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false">
<layout xsi:type="CsvLayout" quoting="All" >
<column name="Date" layout="${date:universalTime=True:format=o}" />
<column name="Server" layout="${machinename}" />
<column name="ThreadId" layout="${threadid}" />
<column name="Application" layout="${mdlc:item=Application}" />
<column name="Logger" layout="${logger}" />
<column name="Level" layout="${level}" />
<column name="Message" layout="${message}" />
<column name="Exception" layout="${exception:format=ToString}" />
</layout>
</target>
</target>
<target name="MultiFile" type="RoundRobinGroup">
<target type="AsyncWrapper" overflowAction="Block" timeToSleepBetweenBatches="0">
<target type="File" fileName="C:\Temp\Log\NLogPerformanceMulti0.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false" layout="${longdate} [${threadid}] ${level:uppercase=true} ${logger} - ${message}${exception:format=tostring}" />
</target>
<target type="AsyncWrapper" overflowAction="Block" timeToSleepBetweenBatches="0">
<target type="File" fileName="C:\Temp\Log\NLogPerformanceMulti1.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false" layout="${longdate} [${threadid}] ${level:uppercase=true} ${logger} - ${message}${exception:format=tostring}" />
</target>
<target type="AsyncWrapper" overflowAction="Block" timeToSleepBetweenBatches="0">
<target type="File" fileName="C:\Temp\Log\NLogPerformanceMulti2.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false" layout="${longdate} [${threadid}] ${level:uppercase=true} ${logger} - ${message}${exception:format=tostring}" />
</target>
<target type="AsyncWrapper" overflowAction="Block" timeToSleepBetweenBatches="0">
<target type="File" fileName="C:\Temp\Log\NLogPerformanceMulti3.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false" layout="${longdate} [${threadid}] ${level:uppercase=true} ${logger} - ${message}${exception:format=tostring}" />
</target>
<target type="AsyncWrapper" overflowAction="Block" timeToSleepBetweenBatches="0">
<target type="File" fileName="C:\Temp\Log\NLogPerformanceMulti4.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false" layout="${longdate} [${threadid}] ${level:uppercase=true} ${logger} - ${message}${exception:format=tostring}" />
</target>
<target type="AsyncWrapper" overflowAction="Block" timeToSleepBetweenBatches="0">
<target type="File" fileName="C:\Temp\Log\NLogPerformanceMulti5.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false" layout="${longdate} [${threadid}] ${level:uppercase=true} ${logger} - ${message}${exception:format=tostring}" />
</target>
<target type="AsyncWrapper" overflowAction="Block" timeToSleepBetweenBatches="0">
<target type="File" fileName="C:\Temp\Log\NLogPerformanceMulti6.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false" layout="${longdate} [${threadid}] ${level:uppercase=true} ${logger} - ${message}${exception:format=tostring}" />
</target>
<target type="AsyncWrapper" overflowAction="Block" timeToSleepBetweenBatches="0">
<target type="File" fileName="C:\Temp\Log\NLogPerformanceMulti7.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false" layout="${longdate} [${threadid}] ${level:uppercase=true} ${logger} - ${message}${exception:format=tostring}" />
</target>
<target type="AsyncWrapper" overflowAction="Block" timeToSleepBetweenBatches="0">
<target type="File" fileName="C:\Temp\Log\NLogPerformanceMulti8.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false" layout="${longdate} [${threadid}] ${level:uppercase=true} ${logger} - ${message}${exception:format=tostring}" />
</target>
<target type="AsyncWrapper" overflowAction="Block" timeToSleepBetweenBatches="0">
<target type="File" fileName="C:\Temp\Log\NLogPerformanceMulti9.txt" autoFlush="false" keepFileOpen="true" concurrentWrites="false" layout="${longdate} [${threadid}] ${level:uppercase=true} ${logger} - ${message}${exception:format=tostring}" />
</target>
</target>
</targets>
<rules>
<logger name="NullLogger*" minLevel="Trace" writeTo="NullWithoutFormat" />
<logger name="Logger*" minlevel="Trace" writeTo="AsyncFile" />
<logger name="SyncLogger*" minlevel="Trace" writeTo="SyncFile" />
<logger name="PerfLogger*" minlevel="Trace" writeTo="AsyncFilePerf" />
<logger name="PerfSyncLogger*" minlevel="Trace" writeTo="SyncFilePerf" />
<logger name="PerfArchiveLogger*" minlevel="Trace" writeTo="SyncFilePerfArchive" />
<logger name="JsonLogger*" minlevel="Trace" writeTo="AsyncFileJson" />
<logger name="JsonSyncLogger*" minlevel="Trace" writeTo="SyncFileJson" />
<logger name="CsvLogger*" minlevel="Trace" writeTo="AsyncFileCsv" />
<logger name="CsvSyncLogger*" minlevel="Trace" writeTo="SyncFileCsv" />
<logger name="SimpleLogger*" minlevel="Trace" writeTo="AsyncFileSimple" />
<logger name="SimpleSyncLogger*" minlevel="Trace" writeTo="SyncFileSimple" />
<logger name="MultiLogger*" minlevel="Trace" writeTo="MultiFile" />
</rules>
</nlog>