-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNLog.config
More file actions
28 lines (25 loc) · 1.35 KB
/
NLog.config
File metadata and controls
28 lines (25 loc) · 1.35 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
<?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"
throwExceptions="true" internalLogFile="c:\nlog.txt" internalLogLevel="Debug">
<extensions>
<add assembly="NLog.Extended" />
</extensions>
<targets>
<target xsi:type="File" name="file" fileName="${basedir}\logs\${date:format=yyyy-MM-dd}-WebrootUI2.log"
layout="${date} | ${aspnet-user-identity} | ${message} | ${exception:format=ToString,StackTrace} "/>
<target name="database" xsi:type="Database"
connectionString="Data Source=HP-PC\SQLEXPRESS;Initial Catalog=WebrootUI2;Integrated Security=True;">
<commandText>insert into [dbo].[s_EventLog] ([Level],[Message],[Timestamp],UserId) values (@level,@message,@timestamp,@UserId)</commandText>
<parameter name="@level" layout="${level}" />
<parameter name="@message" layout="${message}" />
<parameter name="@timestamp" layout="${date}" />
<parameter name="@UserId" layout="${event-context:item=UserId}" />
</target>
</targets>
<rules>
<logger name="*" levels="info,warn,error" appendTo="database"></logger>
<logger name="*" levels="debug" appendTo="file"></logger>
<logger name="Name.Space" minlevel="Debug" maxlevel="Error" final="true"></logger>
</rules>
</nlog>