| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_HOSTNAME
Default hostname if it isn't set manually (or can't be determined).
|
static String |
DEFAULT_PLATFORM
Default platform if it isn't set manually.
|
static long |
HOSTNAME_CACHE_DURATION
Duration of the hostname caching.
|
| Constructor and Description |
|---|
EventBuilder()
Creates a new EventBuilder to prepare a new
Event. |
EventBuilder(UUID eventId)
Creates a new EventBuilder to prepare a new
Event. |
| Modifier and Type | Method and Description |
|---|---|
EventBuilder |
addExtra(String extraName,
Object extraValue)
Adds an extra property to the event.
|
EventBuilder |
addSentryInterface(SentryInterface sentryInterface)
Adds a
SentryInterface to the event. |
EventBuilder |
addTag(String tagKey,
String tagValue)
Adds a tag to an event.
|
Event |
build()
Finalises the
Event and returns it. |
EventBuilder |
generateChecksum(String contentToChecksum)
Generates a checksum from a given content and set it to the current event.
|
EventBuilder |
setChecksum(String checksum)
Sets the checksum for the current event.
|
EventBuilder |
setCulprit(StackTraceElement frame)
Sets the culprit in the event based on a
StackTraceElement. |
EventBuilder |
setCulprit(String culprit)
Sets the culprit in the event.
|
EventBuilder |
setLevel(Event.Level level)
Sets the log level in the event.
|
EventBuilder |
setLogger(String logger)
Sets the logger in the event.
|
EventBuilder |
setMessage(String message)
Sets the message in the event.
|
EventBuilder |
setPlatform(String platform)
Sets the platform in the event.
|
EventBuilder |
setServerName(String serverName)
Sets the serverName in the event.
|
EventBuilder |
setTimestamp(Date timestamp)
Sets the timestamp in the event.
|
public static final String DEFAULT_PLATFORM
public static final String DEFAULT_HOSTNAME
public static final long HOSTNAME_CACHE_DURATION
HostnameCachepublic EventBuilder()
Event.
Automatically generates the id of the new event.
public EventBuilder setMessage(String message)
message - message of the event.EventBuilder for chained calls.public EventBuilder setTimestamp(Date timestamp)
timestamp - timestamp of the event.EventBuilder for chained calls.public EventBuilder setLevel(Event.Level level)
level - log level of the event.EventBuilder for chained calls.public EventBuilder setLogger(String logger)
logger - logger of the event.EventBuilder for chained calls.public EventBuilder setPlatform(String platform)
platform - platform of the event.EventBuilder for chained calls.public EventBuilder setCulprit(StackTraceElement frame)
StackTraceElement.frame - stack frame during which the event was captured.EventBuilder for chained calls.public EventBuilder setCulprit(String culprit)
culprit - culprit.EventBuilder for chained calls.public EventBuilder addTag(String tagKey, String tagValue)
This allows to set a tag value in different contexts.
tagKey - name of the tag.tagValue - value of the tag.EventBuilder for chained calls.public EventBuilder setServerName(String serverName)
serverName - name of the server responsible for the event.EventBuilder for chained calls.public EventBuilder addExtra(String extraName, Object extraValue)
extraName - name of the extra property.extraValue - value of the extra property.EventBuilder for chained calls.public EventBuilder generateChecksum(String contentToChecksum)
contentToChecksum - content to checksum.EventBuilder for chained calls.public EventBuilder setChecksum(String checksum)
It's recommended to rely instead on the checksum system provided by Sentry.
checksum - checksum for the event.EventBuilder for chained calls.public EventBuilder addSentryInterface(SentryInterface sentryInterface)
SentryInterface to the event.
If a SentryInterface with the same interface name has already been added, the new one will replace
the old one.
sentryInterface - sentry interface to add to the event.EventBuilder for chained calls.Copyright © 2012–2014. All rights reserved.