public class Raven extends Object
Event that will be processed and sent to a Sentry server.
It is recommended to create an instance of Raven through
RavenFactory.createRavenInstance(net.kencochrane.raven.dsn.Dsn), this will use the best factory available to
create a sensible instance of Raven.
| Modifier and Type | Field and Description |
|---|---|
static String |
NAME
Version of this client, the major version is the current supported Sentry protocol, the minor version changes
for each release of this project.
|
| Constructor and Description |
|---|
Raven() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBuilderHelper(EventBuilderHelper builderHelper)
Adds a builder helper.
|
Set<EventBuilderHelper> |
getBuilderHelpers() |
Connection |
getConnection() |
static boolean |
isManagingThread()
Checks whether the current thread is managed by Raven or not.
|
void |
removeBuilderHelper(EventBuilderHelper builderHelper)
Removes a builder helper.
|
void |
runBuilderHelpers(EventBuilder eventBuilder)
Runs the
EventBuilderHelper against the EventBuilder to obtain additional information with a
MDC-like system. |
void |
sendEvent(Event event)
Sends a built
Event to the Sentry server. |
void |
sendException(Exception exception)
Sends an exception to the Sentry server.
|
void |
sendMessage(String message)
Sends a message to the Sentry server.
|
void |
setConnection(Connection connection) |
static void |
startManagingThread()
Sets the current thread as managed by Raven.
|
static void |
stopManagingThread()
Sets the current thread as not managed by Raven.
|
public static final String NAME
public static void startManagingThread()
The logs generated by Threads managed by Raven will not send logs to Sentry.
public static void stopManagingThread()
The logs generated by Threads not managed by Raven will send logs to Sentry.
public static boolean isManagingThread()
true if the thread is managed by Raven, false otherwise.public void runBuilderHelpers(EventBuilder eventBuilder)
EventBuilderHelper against the EventBuilder to obtain additional information with a
MDC-like system.eventBuilder - event builder containing a not yet finished event.public void sendEvent(Event event)
Event to the Sentry server.event - event to send to Sentry.public void sendMessage(String message)
The message will be logged at the Event.Level#INFO level.
message - message to send to Sentry.public void sendException(Exception exception)
The Exception will be logged at the Event.Level#ERROR level.
exception - exception to send to Sentry.public void removeBuilderHelper(EventBuilderHelper builderHelper)
builderHelper - builder helper to remove.public void addBuilderHelper(EventBuilderHelper builderHelper)
builderHelper - builder helper to add.public Set<EventBuilderHelper> getBuilderHelpers()
public Connection getConnection()
public void setConnection(Connection connection)
Copyright © 2012–2014. All rights reserved.