Skip to content

Instantly share code, notes, and snippets.

@meriturva
Last active January 16, 2020 21:07
Show Gist options
  • Save meriturva/8fcc97a22e765d5aa0700fcce0e428f4 to your computer and use it in GitHub Desktop.
Save meriturva/8fcc97a22e765d5aa0700fcce0e428f4 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<!-- XSD manual extracted from package NLog.Schema: https://www.nuget.org/packages/NLog.Schema-->
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xsi:schemaLocation="NLog NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true">
<extensions>
<add assembly="Sentry.NLog" />
</extensions>
<targets>
<target xsi:type="File" name="file" layout="${date}|${level:uppercase=true}|${message} ${exception:format=tostring}|${logger}|${all-event-properties}" fileName="${basedir}/logs/logfile.txt" archiveFileName="${basedir}/logs/logfile.{#}.txt" archiveEvery="Day" maxArchiveFiles="7" />
<target xsi:type="Console" name="console" layout="${date}|${level:uppercase=true}|${message} ${exception:format=tostring}|${logger}|${all-event-properties}" />
<target xsi:type="Sentry" name="sentry" dsn="https://xxxxxx@sentry.io/xxxx">
<options
environment="develop"
attachStacktrace="true"
sendDefaultPii="true"
shutdownTimeoutSeconds="5">
</options>
</target>
</targets>
<rules>
<logger ref="debug" name="*" minlevel="Debug" writeTo="console" />
<logger ref="info" name="*" minlevel="Info" writeTo="file" />
<logger ref="error" name="*" minlevel="Error" writeTo="sentry" />
</rules>
</nlog>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment