forked from IvanMurzak/Unity-MCP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNLog.config
More file actions
52 lines (49 loc) · 2.66 KB
/
NLog.config
File metadata and controls
52 lines (49 loc) · 2.66 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
<?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">
<targets>
<!-- Write logs to a file -->
<target
xsi:type="File"
name="logFile"
fileName="logs/server-log.txt"
archiveAboveSize="10485760"
archiveNumbering="Rolling"
maxArchiveFiles="5"
layout="${longdate} | ${level:uppercase=true:padding=-5} | ${logger} | ${message} ${exception:format=toString}" />
<target
xsi:type="File"
name="errorLogFile"
fileName="logs/server-log-error.txt"
archiveAboveSize="10485760"
archiveNumbering="Rolling"
maxArchiveFiles="5"
layout="${longdate} | ${level:uppercase=true:padding=-5} | ${callsite:className=true:includeNamespace=false} | ${message} ${exception:format=toString}" />
<!-- Write logs to console with Microsoft-style colors -->
<target
xsi:type="ColoredConsole"
name="console"
layout="[${time:HH:mm:ss:fff}] ${when:when=level==LogLevel.Trace:inner=trce}${when:when=level==LogLevel.Debug:inner=dbug}${when:when=level==LogLevel.Info:inner=info}${when:when=level==LogLevel.Warn:inner=warn}${when:when=level==LogLevel.Error:inner=fail}${when:when=level==LogLevel.Fatal:inner=crit}: ${logger}[${event-properties:item=EventId_Id:whenEmpty=0}]${newline} ${message} ${exception:format=toString}">
<highlight-row condition="level == LogLevel.Fatal" foregroundColor="White" backgroundColor="Red" />
<highlight-row condition="level == LogLevel.Error" foregroundColor="Red" />
<highlight-row condition="level == LogLevel.Warn" foregroundColor="Yellow" />
<highlight-row condition="level == LogLevel.Info" foregroundColor="White" />
<highlight-row condition="level == LogLevel.Debug" foregroundColor="Gray" />
<highlight-row condition="level == LogLevel.Trace" foregroundColor="Gray" />
<highlight-word text="trce:" foregroundColor="Gray" />
<highlight-word text="dbug:" foregroundColor="Gray" />
<highlight-word text="info:" foregroundColor="DarkGreen" />
<highlight-word text="warn:" foregroundColor="Yellow" />
<highlight-word text="fail:" foregroundColor="Red" />
<highlight-word text="crit:" foregroundColor="White" backgroundColor="Red" />
</target>
</targets>
<rules>
<logger name="Microsoft.*" maxlevel="Warn" final="true" />
<logger name="*" minlevel="Trace" maxlevel="Warn" writeTo="logFile,console" />
<logger name="*" minlevel="Error" writeTo="logFile,console,errorLogFile" />
</rules>
<extensions>
<add assembly="NLog.Web.AspNetCore"/>
</extensions>
</nlog>