public class SentryAppender
extends ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
| Modifier and Type | Field and Description |
|---|---|
protected String |
dsn
DSN property of the appender.
|
static String |
LOGBACK_MARKER
Name of the
Event.extra property containing Maker details. |
protected Raven |
raven
Current instance of
Raven. |
protected String |
ravenFactory
Name of the
RavenFactory being used. |
protected Map<String,String> |
tags
Additional tags to be sent to sentry.
|
static String |
THREAD_NAME
Name of the
Event.extra property containing the Thread name. |
| Constructor and Description |
|---|
SentryAppender()
Creates an instance of SentryAppender.
|
SentryAppender(Raven raven)
Creates an instance of SentryAppender.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
append(ch.qos.logback.classic.spi.ILoggingEvent iLoggingEvent) |
protected Event |
buildEvent(ch.qos.logback.classic.spi.ILoggingEvent iLoggingEvent)
Builds an Event based on the logging event.
|
protected static Event.Level |
formatLevel(ch.qos.logback.classic.Level level)
Transforms a
Level into an Event.Level. |
protected static List<String> |
formatMessageParameters(Object[] parameters)
Extracts message parameters into a List of Strings.
|
protected void |
initRaven()
Initialises the Raven instance.
|
void |
setDsn(String dsn) |
void |
setRavenFactory(String ravenFactory) |
void |
setTags(String tags)
Set the tags that should be sent along with the events.
|
void |
stop() |
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, start, toStringaddError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextpublic static final String LOGBACK_MARKER
Event.extra property containing Maker details.public static final String THREAD_NAME
Event.extra property containing the Thread name.protected Raven raven
Raven.initRaven()protected String dsn
Might be null in which case the DSN should be detected automatically.
protected String ravenFactory
RavenFactory being used.
Might be null in which case the factory should be defined automatically.
public SentryAppender()
public SentryAppender(Raven raven)
raven - instance of Raven to use with this appender.protected static List<String> formatMessageParameters(Object[] parameters)
null parameters are kept as null.
parameters - parameters provided to the logging system.protected static Event.Level formatLevel(ch.qos.logback.classic.Level level)
Level into an Event.Level.level - original level as defined in logback.protected void append(ch.qos.logback.classic.spi.ILoggingEvent iLoggingEvent)
The raven instance is started in this method instead of AppenderBase.start() in order to avoid substitute loggers
being generated during the instantiation of Raven.
More on www.slf4j.org/codes.html#substituteLogger
append in class ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>protected void initRaven()
protected Event buildEvent(ch.qos.logback.classic.spi.ILoggingEvent iLoggingEvent)
iLoggingEvent - Log generated.public void setDsn(String dsn)
public void setRavenFactory(String ravenFactory)
public void setTags(String tags)
tags - A String of tags. key/values are separated by colon(:) and tags are separated by commas(,).public void stop()
stop in interface ch.qos.logback.core.spi.LifeCyclestop in class ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>Copyright © 2012–2013. All rights reserved.