Package io.sentry.jul
Class SentryHandler
java.lang.Object
java.util.logging.Handler
io.sentry.jul.SentryHandler
Logging handler in charge of sending the java.util.logging records to a Sentry server.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of SentryHandler.SentryHandler(@NotNull io.sentry.SentryOptions options) Creates an instance of SentryHandler.SentryHandler(@NotNull io.sentry.SentryOptions options, boolean enableExternalConfiguration) Creates an instance of SentryHandler. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcaptureLog(@NotNull LogRecord loggingEvent) Captures a Sentry log from JULsLogRecord.voidclose()voidflush()@NotNull Level@NotNull Level@NotNull LevelbooleanvoidvoidsetMinimumBreadcrumbLevel(@Nullable Level minimumBreadcrumbLevel) voidsetMinimumEventLevel(@Nullable Level minimumEventLevel) voidsetMinimumLevel(@Nullable Level minimumLevel) voidsetPrintfStyle(boolean printfStyle) Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
Field Details
-
MECHANISM_TYPE
- See Also:
-
THREAD_ID
Name of theSentryEventextra property containing the Thread id.- See Also:
-
-
Constructor Details
-
SentryHandler
public SentryHandler()Creates an instance of SentryHandler. -
SentryHandler
public SentryHandler(@NotNull @NotNull io.sentry.SentryOptions options) Creates an instance of SentryHandler.- Parameters:
options- the SentryOptions
-
SentryHandler
public SentryHandler(@NotNull @NotNull io.sentry.SentryOptions options, boolean enableExternalConfiguration) Creates an instance of SentryHandler.- Parameters:
options- the SentryOptionsenableExternalConfiguration- whether external options like sentry.properties and ENV vars should be parsed
-
-
Method Details
-
publish
-
captureLog
Captures a Sentry log from JULsLogRecord.- Parameters:
loggingEvent- the JUL log record
-
flush
public void flush() -
close
- Specified by:
closein classHandler- Throws:
SecurityException
-
setPrintfStyle
public void setPrintfStyle(boolean printfStyle) -
setMinimumBreadcrumbLevel
-
getMinimumBreadcrumbLevel
-
setMinimumEventLevel
-
getMinimumEventLevel
-
setMinimumLevel
-
getMinimumLevel
-
isPrintfStyle
public boolean isPrintfStyle()
-