RollbarAppender is a custom log4net appender for reporting events to Rollbar. This package depends on the RollbarSharp package.
Install-Package log4net.Rollbar
You must add the appender to your log4net section in app or web.config
<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="..."/>
Or you can use the RollbarAppenderConfigurator when your application initializes.
class Program
{
static void Main(string[] args)
{
RollbarAppenderConfigurator.Configure("<accessToken>");
}
}