First Initial
This commit is contained in:
30
nlog.config
Normal file
30
nlog.config
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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="info"
|
||||
internalLogFile="/logs/webapi-internal-nlog.txt">
|
||||
|
||||
<!-- enable asp.net core layout renderers -->
|
||||
<extensions>
|
||||
<add assembly="NLog.Web.AspNetCore"/>
|
||||
</extensions>
|
||||
|
||||
<!-- the targets to write to -->
|
||||
<targets>
|
||||
<!-- another file log, only own logs. Uses some ASP.NET core renderers -->
|
||||
<target xsi:type="File" name="ownFile-web" fileName="/logs/webapi-${shortdate}.txt"
|
||||
layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${aspnet-user-identity}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}" />
|
||||
</targets>
|
||||
|
||||
<!-- rules to map from logger name to target -->
|
||||
<rules>
|
||||
<!--All logs, including from Microsoft-->
|
||||
<!--<logger name="*" minlevel="Trace" writeTo="allfile" />-->
|
||||
|
||||
<!--Skip non-critical Microsoft logs and so log only own logs-->
|
||||
<logger name="Microsoft.*" maxLevel="Info" final="true" />
|
||||
<!-- BlackHole without writeTo -->
|
||||
<logger name="*" minlevel="Trace" writeTo="ownFile-web" />
|
||||
</rules>
|
||||
</nlog>
|
||||
Reference in New Issue
Block a user