-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnlog.config
48 lines (39 loc) · 1.88 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
<?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="Logs\internal-nlog.log"
maxArchiveFiles="30"
archiveEvery="Day"
archiveFileName="Logs\internal-nlog-archive-${shortdate}.log">
<!-- enable asp.net core layout renderers -->
<extensions>
<add assembly="NLog.Web.AspNetCore"/>
</extensions>
<!-- the targets to write to -->
<targets async="true">
<!-- another file log, only own logs. Uses some ASP.NET core renderers -->
<target xsi:type="File"
name="ownFile-web"
fileName="Logs\rdpmon-${shortdate}.log"
maxArchiveFiles="30"
archiveEvery="Day"
archiveFileName="Logs\rdpmon-archive-${shortdate}.log"
layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|controller: ${aspnet-mvc-controller}|action: ${aspnet-mvc-action}|TraceId: ${aspnet-traceidentifier}"
/>
<!--Log to VS output window-->
<target name="debugger" xsi:type="Debugger" layout="${logger}::${message}"/>
<!--<target name="log4view" xsi:type="NLogViewer" address="tcp://127.0.0.1:878"
KeepConnection="false" OnConnectionOverflow="Block" MaxConnections="5" />-->
</targets>
<!-- rules to map from logger name to target -->
<rules>
<!--Log to VS output window-->
<logger name="*" minlevel="Trace" writeTo="debugger" />
<!--Skip non-critical Microsoft logs and so log only own logs-->
<logger name="Microsoft.*" maxlevel="Info" final="true" />
<logger name="*" minlevel="Warn" writeTo="ownFile-web"></logger>
<!--<logger name="*" minlevel="Trace" writeTo="log4view" />-->
</rules>
</nlog>