mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-12-26 12:15:42 +08:00
44 lines
2.4 KiB
XML
44 lines
2.4 KiB
XML
<?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 ../CI/NLog.xsd"
|
|
autoReload="true" throwExceptions="false" throwConfigExceptions="true" internalLogLevel="Off">
|
|
<extensions>
|
|
<add assembly="Sentry.NLog"/>
|
|
</extensions>
|
|
<targets>
|
|
<target name="WPFLogger" xsi:type="MethodCall" className="BililiveRecorder.WPF.Models.LogModel, BililiveRecorder.WPF" methodName="AddLog">
|
|
<parameter layout="[${date:format=HH\:mm\:ss}] ${level:upperCase=true} ${event-properties:item=roomid} ${message} ${exception:format=Message}" />
|
|
</target>
|
|
<target name="file" xsi:type="File" encoding="utf-8" lineEnding="CRLF" fileName="${basedir}/logs/log.current.txt"
|
|
maxArchiveFiles="15" archiveFileName="${basedir}/logs/log.{#}.txt" archiveNumbering="Date"
|
|
archiveEvery="Day" archiveDateFormat="yyyyMMdd">
|
|
<layout xsi:type="JsonLayout">
|
|
<attribute name='time' layout='${longdate}'/>
|
|
<attribute name='level' layout='${level:upperCase=true}'/>
|
|
<attribute name='pid' layout='${processid}'/>
|
|
<attribute name='logger' layout='${logger}'/>
|
|
<attribute name='roomid' layout='${event-properties:item=roomid}'/>
|
|
<attribute name='message' escapeUnicode="false" layout='${message}'/>
|
|
<attribute name='exception' escapeUnicode="false" encode='false'>
|
|
<layout xsi:type='JsonLayout'>
|
|
<attribute name='type' escapeUnicode="false" layout='${exception:format=Type}'/>
|
|
<attribute name='message' escapeUnicode="false" layout='${exception:format=Message}'/>
|
|
<attribute name='tostring' escapeUnicode="false" layout='${exception:format=ToString}'/>
|
|
</layout>
|
|
</attribute>
|
|
</layout>
|
|
</target>
|
|
<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>
|
|
</targets>
|
|
<rules>
|
|
<logger name="*" writeTo="sentry"/>
|
|
<logger name="*" minlevel="Info" writeTo="WPFLogger"/>
|
|
<logger name="*" minlevel="Debug" writeTo="file"/>
|
|
</rules>
|
|
</nlog>
|