2018-03-27 06:10:30 +08:00
|
|
|
<?xml version="1.0" encoding="utf-8" ?>
|
2020-12-16 19:12:36 +08:00
|
|
|
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
autoReload="true" throwExceptions="false" throwConfigExceptions="true" internalLogLevel="Off">
|
|
|
|
<extensions>
|
|
|
|
<add assembly="Sentry.NLog"/>
|
|
|
|
</extensions>
|
2018-03-27 06:10:30 +08:00
|
|
|
<targets>
|
2020-11-27 18:51:02 +08:00
|
|
|
<target name="WPFLogger" xsi:type="MethodCall" className="BililiveRecorder.WPF.Models.LogModel, BililiveRecorder.WPF" methodName="AddLog">
|
2020-12-16 19:12:36 +08:00
|
|
|
<parameter layout="[${date:format=HH\:mm\:ss}] ${level:upperCase=true} ${event-properties:item=roomid} ${message} ${exception:format=Message}" />
|
2018-04-14 10:00:29 +08:00
|
|
|
</target>
|
2020-12-16 19:12:36 +08:00
|
|
|
<target name="file" xsi:type="File" encoding="utf-8" lineEnding="CRLF" fileName="logs/log.txt"
|
|
|
|
maxArchiveFiles="15" archiveFileName="logs/log_archive.{#}.txt" archiveNumbering="Date"
|
|
|
|
archiveEvery="Day" archiveDateFormat="yyyyMMdd">
|
2018-04-14 10:00:29 +08:00
|
|
|
<layout xsi:type="JsonLayout">
|
2020-12-16 19:12:36 +08:00
|
|
|
<attribute name='time' layout='${longdate}'/>
|
2018-04-14 10:00:29 +08:00
|
|
|
<attribute name='level' layout='${level:upperCase=true}'/>
|
2018-11-01 23:40:50 +08:00
|
|
|
<attribute name='pid' layout='${processid}'/>
|
2018-04-14 10:00:29 +08:00
|
|
|
<attribute name='logger' layout='${logger}'/>
|
|
|
|
<attribute name='roomid' layout='${event-properties:item=roomid}'/>
|
|
|
|
<attribute name='message' layout='${message}'/>
|
|
|
|
<attribute name='exception' encode='false'>
|
|
|
|
<layout xsi:type='JsonLayout'>
|
|
|
|
<attribute name='type' layout='${exception:format=Type}'/>
|
|
|
|
<attribute name='message' layout='${exception:format=Message}'/>
|
|
|
|
<attribute name='tostring' layout='${exception:format=ToString}'/>
|
|
|
|
</layout>
|
|
|
|
</attribute>
|
|
|
|
</layout>
|
2018-03-27 06:10:30 +08:00
|
|
|
</target>
|
2020-12-16 19:12:36 +08:00
|
|
|
<target xsi:type="Sentry" name="sentry" layout="${message}"
|
|
|
|
breadcrumbLayout="${event-properties:item=roomid} ${message}"
|
|
|
|
minimumBreadcrumbLevel="Debug" minimumEventLevel="Error">
|
|
|
|
<options initializeSdk="false"/>
|
|
|
|
<tag name="logger" layout="${logger}" />
|
|
|
|
</target>
|
2018-03-27 06:10:30 +08:00
|
|
|
</targets>
|
|
|
|
<rules>
|
2020-12-16 19:12:36 +08:00
|
|
|
<logger name="*" writeTo="sentry"/>
|
2018-03-27 06:10:30 +08:00
|
|
|
<logger name="*" minlevel="Info" writeTo="WPFLogger"/>
|
2020-11-24 20:27:29 +08:00
|
|
|
<logger name="*" minlevel="Debug" writeTo="file"/>
|
2018-03-27 06:10:30 +08:00
|
|
|
</rules>
|
|
|
|
</nlog>
|