You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.9 KiB
30 lines
1.9 KiB
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
throwExceptions="true" internalLogLevel="Debug">
|
|
<extensions>
|
|
<!--添加扩展Exceptionless程序集-->
|
|
<add assembly="Exceptionless.NLog" />
|
|
</extensions>
|
|
<targets async="true">
|
|
<!--写入本地文件-->
|
|
<target name="File" xsi:type="File" fileName="${basedir}/logs/${shortdate}.log"
|
|
layout=" ${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}| ${newline}">
|
|
</target>
|
|
<target xsi:type="Exceptionless" name="Exceptionless" apiKey="JlefqejPIZfmMTXhOhJhjc4LzL4Xs5IIkyYfniMg"
|
|
serverUrl="http://81.71.148.57:5000">
|
|
</target>
|
|
<target xsi:type="File" name="debug" fileName="../logs/debug-${shortdate}.log"
|
|
layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}" />
|
|
<target xsi:type="File" name="warn" fileName="../logs/warn-${shortdate}.log"
|
|
layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}" />
|
|
<target xsi:type="File" name="error" fileName="../logs/error-${shortdate}.log"
|
|
layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}" />
|
|
<target xsi:type="Console" name="console" layout="${message}" />
|
|
</targets>
|
|
<rules>
|
|
<!--本地文件-->
|
|
<!--<logger name="*" writeTo="File" />-->
|
|
<!--上报Exceptionless-->
|
|
<logger name='*' writeTo='Exceptionless' />
|
|
</rules>
|
|
</nlog>
|