public class JsonMarshaller extends Object implements Marshaller
The content can also be compressed with DeflaterOutputStream in which case the binary result is encoded
in base 64.
Marshaller.UncloseableOutputStream| Modifier and Type | Field and Description |
|---|---|
static String |
CHECKSUM
Checksum for the event, allowing to group events with a similar checksum.
|
static String |
CULPRIT
Function call which was the primary perpetrator of this event.
|
static String |
EVENT_ID
Hexadecimal string representing a uuid4 value.
|
static String |
EXTRA
An arbitrary mapping of additional metadata to store with the event.
|
static String |
LEVEL
The record severity.
|
static String |
LOGGER
The name of the logger which created the record.
|
static int |
MAX_MESSAGE_LENGTH
Maximum length for a message.
|
static String |
MESSAGE
User-readable representation of this event.
|
static String |
MODULES
A list of relevant modules and their versions.
|
static String |
PLATFORM
A string representing the platform the client is submitting from.
|
static String |
SERVER_NAME
Identifies the host client from which the event was recorded.
|
static String |
TAGS
A map or list of tags for this event.
|
static String |
TIMESTAMP
Indicates when the logging record was created.
|
| Constructor and Description |
|---|
JsonMarshaller() |
| Modifier and Type | Method and Description |
|---|---|
<T extends SentryInterface,F extends T> |
addInterfaceBinding(Class<F> sentryInterfaceClass,
InterfaceBinding<T> binding)
Add an interface binding to send a type of
SentryInterface through a JSON stream. |
void |
marshall(Event event,
OutputStream destination)
Serialises an event and sends it through an
OutputStream. |
void |
setCompression(boolean compression)
Enables the JSON compression with deflate.
|
public static final String EVENT_ID
public static final String MESSAGE
public static final String TIMESTAMP
public static final String LEVEL
public static final String LOGGER
public static final String PLATFORM
public static final String CULPRIT
public static final String TAGS
public static final String SERVER_NAME
public static final String MODULES
public static final String EXTRA
public static final String CHECKSUM
public static final int MAX_MESSAGE_LENGTH
public void marshall(Event event, OutputStream destination)
MarshallerOutputStream.
The marshaller should not close the given stream, use Marshaller.UncloseableOutputStream to prevent automatic calls
to OutputStream.close().
marshall in interface Marshallerevent - event to serialise.destination - destination stream.public <T extends SentryInterface,F extends T> void addInterfaceBinding(Class<F> sentryInterfaceClass, InterfaceBinding<T> binding)
SentryInterface through a JSON stream.T - Type of SentryInterface received by the InterfaceBinding.F - Type of the interface stored in the event to send to the InterfaceBinding.sentryInterfaceClass - Actual type of SentryInterface supported by the InterfaceBindingbinding - InterfaceBinding converting SentryInterfaces of type sentryInterfaceClass.public void setCompression(boolean compression)
compression - state of the compression.Copyright © 2012–2014. All rights reserved.