Selector/Selector.Web/nlog.config

52 lines
2.0 KiB
Plaintext
Raw Normal View History

2021-10-23 22:16:37 +01:00
<?xml version="1.0" encoding="utf-8" ?>
<!-- XSD manual extracted from package NLog.Schema: https://www.nuget.org/packages/NLog.Schema-->
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xsi:schemaLocation="NLog NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
throwConfigExceptions="true"
2022-06-17 19:08:53 +01:00
internalLogFile="./log/selector.nlog.log"
2021-10-23 22:16:37 +01:00
internalLogLevel="Info" >
<extensions>
<add assembly="NLog.Web.AspNetCore"/>
</extensions>
2022-07-01 22:04:17 +01:00
<variable name="scopeFormat"
value="${all-event-properties:format=[[key]\:[value]]:includeScopeProperties=true:separator= }"/>
2021-10-23 22:16:37 +01:00
<variable name="format"
2022-07-01 22:04:17 +01:00
value="${longdate}|${level:uppercase=true}|${callsite}:${callsite-linenumber}|${message}${onexception:inner=${newline}}${exception:format=tostring,data:exceptionDataSeparator=\r\n}${newline} ${scopeFormat}"/>
2021-10-23 22:16:37 +01:00
<!-- the targets to write to -->
<targets>
<!-- write logs to file -->
<target xsi:type="File"
name="logfile"
2022-06-17 19:08:53 +01:00
fileName="./log/selector-${shortdate}.log"
2021-10-23 22:16:37 +01:00
layout="${format}" />
<target xsi:type="File"
name="tracefile"
2022-06-17 19:08:53 +01:00
fileName="./log/selector.trace-${shortdate}.log"
2021-10-23 22:16:37 +01:00
layout="${format}" />
2022-07-01 22:04:17 +01:00
<target xsi:type="ColoredConsole"
2021-10-23 22:16:37 +01:00
name="logconsole"
layout="${format}" />
</targets>
<!-- rules to map from logger name to target -->
<rules>
2022-07-01 22:04:17 +01:00
<!--<logger name="*" minlevel="Trace" writeTo="tracefile" />-->
2021-10-23 22:16:37 +01:00
<logger name="Selector.*" minlevel="Debug" writeTo="logconsole" />
<!--Output hosting lifetime messages to console target for faster startup detection -->
<logger name="Microsoft.Hosting.Lifetime" minlevel="Info" writeTo="logconsole" final="true" />
<!--Skip non-critical Microsoft logs and so log only own logs (BlackHole) -->
<logger name="Microsoft.*" maxlevel="Info" final="true" />
<logger name="System.Net.Http.*" maxlevel="Info" final="true" />
2022-07-01 22:04:17 +01:00
<!--<logger name="*" minlevel="Debug" writeTo="logfile" />-->
<logger name="Selector.*" minlevel="Info" writeTo="logfile" />
<logger name="Microsoft.*" minlevel="Warning" writeTo="logfile" />
2021-10-23 22:16:37 +01:00
</rules>
</nlog>