Skip to content

Instantly share code, notes, and snippets.

@dnstommy
Created August 12, 2017 17:49
Show Gist options
  • Save dnstommy/b717d88db4527c6152d862d9e1f17680 to your computer and use it in GitHub Desktop.
Save dnstommy/b717d88db4527c6152d862d9e1f17680 to your computer and use it in GitHub Desktop.
namespace Bonfire.LogAppender
{
using log4net.Appender;
using log4net.spi;
using SharpRaven;
using SharpRaven.Data;
public class CustomAppender : AppenderSkeleton
{
public string DSN { get; set; }
protected override void Append(LoggingEvent loggingEvent)
{
if (string.IsNullOrEmpty(DSN)) return;
var ravenClient = new RavenClient(DSN);
ravenClient.Capture(new SentryEvent(loggingEvent.RenderedMessage));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment