SharpRaven Light a lightweight .NET client for Sentry.
It is a Light
version of the oficial lib RavenSharp, it contains just the basic to log the event.
It is designed to be compatible with the oficial lib, so it implements the same interface IClientSentry.cs
.
The usage is also very similar.
- Retrieved from RavenSharp
Instantiate the client with your DSN:
var ravenClient = new RavenClientLight("http://public:secret@example.com/project-id");
Call out to the client in your catch block:
try
{
int i2 = 0;
int i = 10 / i2;
}
catch (Exception exception)
{
ravenClient.Capture(new SentryEvent(exception));
}
You can capture a message without being bound by an exception:
ravenClient.Capture(new SentryEvent("Hello World!"));
You can add additional data to the
Exception.Data
property on exceptions thrown about in your solution:
try
{
// ...
}
catch (Exception exception)
{
exception.Data.Add("SomeKey", "SomeValue");
throw;
}