Skip to content

Instantly share code, notes, and snippets.

@zacatkogan
Last active November 15, 2019 03:41
Show Gist options
  • Select an option

  • Save zacatkogan/8c004ecfb42c8ace0b6216960347fd94 to your computer and use it in GitHub Desktop.

Select an option

Save zacatkogan/8c004ecfb42c8ace0b6216960347fd94 to your computer and use it in GitHub Desktop.
Sample NLog Configuration for adding SumoLogic.Logging.NLog targets to NLog.config
<!-- additional config settings can be found at https://github.com/SumoLogic/sumologic-net-appenders/blob/master/docs/sumologic.logging.nlog.md -->
<?xml version="1.0" encoding="utf-8" ?>
<nlog autoReload="true" internalLogToConsole="Off">
<extensions>
<add assembly="SumoLogic.Logging.NLog"/>
</extensions>
<targets>
<targetxsi:type="SumoLogicTarget" name="sumoLogic" layout="${longdate}|${level:uppercase=true}|${logger}${message}">
<Url>{SumoLogic CollectorUrl}</Url>
<SourceName>ExampleNameNLogTarget</SourceName>
</target>
<target xsi:type="BufferedSumoLogicTarget" name="bufferedSumoLogic" layout="${longdate}|${level:uppercase=true}|${logger}${message}">
<Url>{SumoLogic CollectorUrl}</Url>
<SourceName>ExampleNameNLogBufferedTarget</SourceName>
</target>
</targets>
<rules>
<logger name="*" minLevel="Debug" writeTo="sumoLogic"/>
<logger name="*" minLevel="Debug" writeTo="bufferedSumoLogic"/>
</rules>
</nlog>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment