public class SentryAppender
extends org.apache.log4j.AppenderSkeleton
| Modifier and Type | Field and Description |
|---|---|
protected String |
dsn
DSN property of the appender.
|
static String |
LOG4J_NDC
Name of the
Event.extra property containing NDC details. |
protected Raven |
raven
Current instance of
Raven. |
protected String |
ravenFactory
Name of the
RavenFactory being used. |
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.
|
SentryAppender(Raven raven,
boolean propagateClose)
Creates an instance of SentryAppender.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activateOptions() |
protected void |
append(org.apache.log4j.spi.LoggingEvent loggingEvent) |
protected static StackTraceElement |
asStackTraceElement(org.apache.log4j.spi.LocationInfo location)
Transforms the location info of a log into a stacktrace element (stackframe).
|
protected Event |
buildEvent(org.apache.log4j.spi.LoggingEvent loggingEvent)
Builds an Event based on the logging event.
|
void |
close() |
protected static Event.Level |
formatLevel(org.apache.log4j.Level level)
Transforms a
Level into an Event.Level. |
protected void |
initRaven()
Initialises the Raven instance.
|
boolean |
requiresLayout() |
void |
setDsn(String dsn) |
void |
setRavenFactory(String ravenFactory) |
public static final String LOG4J_NDC
Event.extra property containing NDC 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.public SentryAppender(Raven raven, boolean propagateClose)
raven - instance of Raven to use with this appender.propagateClose - true if the Closeable.close() should be called
when the appender is closed.protected static Event.Level formatLevel(org.apache.log4j.Level level)
Level into an Event.Level.level - original level as defined in log4j.protected static StackTraceElement asStackTraceElement(org.apache.log4j.spi.LocationInfo location)
location - details on the location of the log.public void activateOptions()
activateOptions in interface org.apache.log4j.spi.OptionHandleractivateOptions in class org.apache.log4j.AppenderSkeletonprotected void initRaven()
protected void append(org.apache.log4j.spi.LoggingEvent loggingEvent)
append in class org.apache.log4j.AppenderSkeletonprotected Event buildEvent(org.apache.log4j.spi.LoggingEvent loggingEvent)
loggingEvent - Log generated.public void setDsn(String dsn)
public void setRavenFactory(String ravenFactory)
public void close()
public boolean requiresLayout()
Copyright © 2012–2013. All rights reserved.