Skip to content

RichardF72/log4net.Rollbar

 
 

Repository files navigation

log4net.Rollbar

RollbarAppender is a custom log4net appender for reporting events to Rollbar. This package depends on the RollbarSharp package.

https://rollbar.com

Install

Install-Package log4net.Rollbar

Configuration

config file

You must add the appender to your log4net section in app or web.config

Example

<log4net>
  <appender name="RollbarAppender" type="log4net.RollbarAppender, log4net.Rollbar">
    <param name="AccessToken" value="..." />
  </appender>
  <root>
      <level value="ERROR" />
      <appender-ref ref="RollbarAppender" />
    </root>
</log4net>

The AccessToken is the post_server_item key. If not specified as a parameter you must add it to the <appSettings> with <add key="Rollbar.AccessToken" value="..."/>

Code

Or you can use the RollbarAppenderConfigurator when your application initializes.

Example

class Program
{
  static void Main(string[] args)
  {
    RollbarAppenderConfigurator.Configure("<accessToken>");
  }
}

About

log4net appender that reports to Rollbar

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 98.4%
  • Batchfile 1.6%