public class SentryHandler extends Handler
Modifier and Type | Field and Description |
---|---|
protected boolean |
printfStyle
If true,
String.format() is used to render parameterized log
messages instead of MessageFormat.format() ; Defaults to
false. |
static String |
THREAD_ID
Name of the
Event.extra property containing the Thread id. |
Constructor and Description |
---|
SentryHandler()
Creates an instance of SentryHandler.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected EventBuilder |
createEventBuilder(LogRecord record)
Builds an EventBuilder based on the log record.
|
void |
flush() |
protected String |
formatMessage(String message,
Object[] parameters)
Returns formatted Event message when provided the message template and
parameters.
|
protected static List<String> |
formatMessageParameters(Object[] parameters)
Extracts message parameters into a List of Strings.
|
protected static Event.Level |
getLevel(Level level)
Transforms a
Level into an Event.Level . |
void |
publish(LogRecord record) |
protected void |
retrieveProperties()
Retrieves the properties of the logger.
|
void |
setPrintfStyle(boolean printfStyle) |
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
public static final String THREAD_ID
Event.extra
property containing the Thread id.protected boolean printfStyle
String.format()
is used to render parameterized log
messages instead of MessageFormat.format()
; Defaults to
false.protected static Event.Level getLevel(Level level)
Level
into an Event.Level
.level
- original level as defined in JUL.protected static List<String> formatMessageParameters(Object[] parameters)
null parameters are kept as null.
parameters
- parameters provided to the logging system.protected void retrieveProperties()
protected EventBuilder createEventBuilder(LogRecord record)
record
- Log generated.protected String formatMessage(String message, Object[] parameters)
message
- Message template body.parameters
- Array of parameters for the message.public void close() throws SecurityException
close
in class Handler
SecurityException
public void setPrintfStyle(boolean printfStyle)
Copyright © 2012–2017. All rights reserved.