-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnlog.config
34 lines (31 loc) · 1.98 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
<?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"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="true"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
<!-- internalLogLevel="Trace"> -->
<!-- enable asp.net core layout renderers -->
<extensions>
<add assembly="NLog.Web.AspNetCore"/>
</extensions>
<variable name="brief" value="${longdate} | ${level:uppercase=true} | ${logger} | ${message}" />
<variable name="verbose" value="${longdate} | ${processid} | ${processname} | ${level:uppercase=true} | ${logger} | ${message}${onexception:inner=${newline}${exception:format=tostring}}" />
<variable name="logPath" value="..\..\..\App_Data\logs" />
<variable name="emailSubject" value="(DEBUG) --appname here--" />
<variable name="emailTo" value="[email protected]" />
<variable name="emailFrom" value="[email protected]" />
<targets async="true">
<target name="file" type="File" layout="${verbose}" fileName="${logPath}\log.current.log" archiveFileName="${logPath}\log.{#}.log" archiveNumbering="Date" archiveDateFormat="yyyyMMddHHmm" archiveEvery="Day" maxArchiveFiles="7" concurrentWrites="true" keepFileOpen="false" />
<target name="errorSmtp" type="Mail" layout="${verbose}" subject="${emailSubject}" to="${emailTo}" from="${emailFrom}" useSystemNetMailSettings="true" />
</targets>
<rules>
<logger name="Microsoft.*" maxLevel="Info" final="true" /> <!-- BlackHole without writeTo -->
<logger name="*" minlevel="Debug" writeTo="file" />
<logger name="*" minlevel="Warn" writeTo="errorSmtp" />
<!--<logger name="*" minlevel="Debug" appendTo="database" />-->
<!--Skip non-critical Microsoft logs and so log only own logs-->
<!-- minlevel values="Trace", "Debug", "Info", "Warn", "Error", "Fatal" -->
</rules>
</nlog>