-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNLog.config
More file actions
55 lines (48 loc) · 2.17 KB
/
NLog.config
File metadata and controls
55 lines (48 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?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"
throwExceptions="false"
internalLogLevel="Trace"
internalLogFile="${basedir}\logfileTgBotTrace.txt">
<targets>
<target xsi:type="Database"
name="targetDB"
dbProvider="FirebirdSql.Data.FirebirdClient.FbConnection, FirebirdSql.Data.FirebirdClient, Version=7.5.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c"
connectionString="character set=UTF8; data source=localhost;Database= Quiz.FDB;; Port=3050; User=SYSDBA;Password=masterkey; Dialect=3"
keepConnection="false"
commandType="text"
commandText="INSERT INTO TGLOG (DATE_BEGIN,LOG_LEVEL,LOG_MESSAGE,CLASS_PROGRAM,STACK_TRACE) VALUES (@DT,@LEVEL_ID,@LOG_TEXT,@CLASS,@STACK_TRACE);">
<parameter layout="${longdate}" name="@DT" />
<parameter layout="${level}" name="@LEVEL_ID" />
<parameter layout="${message}" name="@LOG_TEXT" />
<parameter layout="${logger}" name="@CLASS" />
<parameter layout="${stacktrace}" name="@STACK_TRACE" />
</target>
<target name="file1"
xsi:type="File"
fileName="${basedir}\logfileTgBot.txt"
layout="
-----------------${logger} | ${uppercase:${level}} | (${longdate}) -----------------${newline}
${newline}
${message}${newline}
Exception Type: ${exception:format=Type}${newline}
Exception Message = ${exception:format=Message}${newline}
Stack Trace: ${exception:format=StackTrace}${newline}
Target Site: ${exception:format=TargetSite}${newline}">
</target>
<target name="file2"
xsi:type="File"
fileName="C:\logs\logfileTgBot.txt"
layout="
-----------------${logger} | ${uppercase:${level}} | (${longdate}) -----------------${newline}
${newline}
${message}${newline} ">
</target>
</targets>
<rules>
<logger name="*" levels="Error,Fatal" writeTo="file1" />
<logger name="*" levels="info, Debug, Warn" writeTo="file2" />
<logger name="*" minlevel="warn" writeTo="targetDB"/>
</rules>
</nlog>