Skip to content

NLog extension for the RollbarSharp library for reporting to Rollbar.

License

Notifications You must be signed in to change notification settings

mroach/NLog.RollbarSharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLog.RollbarSharp

An NLog target using the RollbarSharp library for sending notifications to Rollbar.

Setup

You'll need to edit your configuration file that holds your NLog settings. For ASP.NET applications this will likely be web.config. Three additions need to be made to extensions, targets, and rules.

<nlog>
    <extensions>
        <add assembly="NLog.RollbarSharp" />
    </extensions>
    <targets>
        <target xsi:type="RollbarSharp" name="rollbar" />
    </targets>
    <rules>
        <logger name="*" minlevel="Warn" writeTo="rollbar" />
    </rules>
</nlog>

Config

You'll need to set your Rollbar access token and environment. This can be done inline with the NLog configuration or in your appSettings.

You have to set the access token. You can optionally set:

  • Endpoint (to override the Rollbar API URL)
  • Environment (e.g. development, production)
  • Platform
  • Language
  • Framework
  • Title

App settings

If you set the configuration here then you'll be able to use the same configuration for the standalone RollbarSharp client if you choose to do so.

<appSettings>
  <add key="Rollbar.AccessToken" value="6703358e9f54081e59bb0d65ee066363"/>
  <add key="Rollbar.Environment" value="development"/>
</appSettings>

Inline

You can configure NLog.RollbarSharp inline like so.

<targets>
  <target xsi:type="RollbarSharp" name="rollbar" accessToken="6703358e9f54081e59bb0d65ee066363" environment="development" />
</target>

About

NLog extension for the RollbarSharp library for reporting to Rollbar.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published