forked from microsoft/AzUrlShortener
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNLog.config
42 lines (38 loc) · 1.85 KB
/
NLog.config
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
<?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">
<!--
See http://nlog-project.org/wiki/Configuration_file
for information on customizing logging rules and outputs.
-->
<extensions>
<add assembly="NLog.Target.Datadog" />
</extensions>
<variable name="logDirectory" value="${basedir}/logs"/>
<variable name="source" value="Url-Shortener"/>
<targets>
<!-- add your targets here -->
<target xsi:type="File" name="f" fileName="${logDirectory}/${shortdate}_log.log"
layout="${longdate} ${callsite} ${uppercase:${level}} ${message}" />
<target xsi:type="DataDog"
name="dataDog"
includeAllProperties="true"
apiKey="">
<field name="ddsource" layout="${source}" />
<field name="host" layout="${machinename}" />
<layout xsi:type="JsonLayout">
<attribute name="message" layout="${message}" />
</layout>
</target>
</targets>
<rules>
<!-- minLevel values:
Trace 0 Most verbose level. Used for development and seldom enabled in production. Ex. Request-payload, Response-payload, Begin-method-X or End-method-X
Debug 1 Debugging the application behavior from internal events of interest. Ex. Executed query, User authenticated, Session expired
Info 2 Information that highlights progress or application lifetime events.
Warn 3 Warnings about validation issues or temporary failures that can be recovered.
Error 4 Errors where functionality has failed or Exception have been caught.
Fatal 5 Most critical level. Application is about to abort. -->
<logger name="STORIS.UrlRedirect" minlevel="Warn" writeTo="dataDog" />
</rules>
</nlog>