Created
August 12, 2017 17:49
-
-
Save dnstommy/b717d88db4527c6152d862d9e1f17680 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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