Class SentryAppender

java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
io.sentry.logback.SentryAppender
All Implemented Interfaces:
ch.qos.logback.core.Appender<ch.qos.logback.classic.spi.ILoggingEvent>, ch.qos.logback.core.spi.ContextAware, ch.qos.logback.core.spi.FilterAttachable<ch.qos.logback.classic.spi.ILoggingEvent>, ch.qos.logback.core.spi.LifeCycle

public class SentryAppender extends ch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
Appender for logback in charge of sending the logged events to a Sentry server.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class ch.qos.logback.core.UnsynchronizedAppenderBase

    name, started

    Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase

    context
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    append(@NotNull ch.qos.logback.classic.spi.ILoggingEvent eventObject)
     
    protected @NotNull Breadcrumb
    createBreadcrumb(@NotNull ch.qos.logback.classic.spi.ILoggingEvent loggingEvent)
    Creates Breadcrumb from Logback's ILoggingEvent.
    protected @NotNull SentryEvent
    createEvent(@NotNull ch.qos.logback.classic.spi.ILoggingEvent loggingEvent)
    Creates SentryEvent from Logback's ILoggingEvent.
    @NotNull ch.qos.logback.classic.Level
     
    @NotNull ch.qos.logback.classic.Level
     
    void
    setEncoder(ch.qos.logback.core.encoder.Encoder<ch.qos.logback.classic.spi.ILoggingEvent> encoder)
     
    void
    setMinimumBreadcrumbLevel(@Nullable ch.qos.logback.classic.Level minimumBreadcrumbLevel)
     
    void
    setMinimumEventLevel(@Nullable ch.qos.logback.classic.Level minimumEventLevel)
     
    void
    setOptions(@Nullable SentryOptions options)
     
    void
     

    Methods inherited from class ch.qos.logback.core.UnsynchronizedAppenderBase

    addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, stop, toString

    Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase

    addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface ch.qos.logback.core.spi.ContextAware

    addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
  • Field Details

  • Constructor Details

    • SentryAppender

      public SentryAppender()
  • Method Details

    • start

      public void start()
      Specified by:
      start in interface ch.qos.logback.core.spi.LifeCycle
      Overrides:
      start in class ch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
    • append

      protected void append(@NotNull @NotNull ch.qos.logback.classic.spi.ILoggingEvent eventObject)
      Specified by:
      append in class ch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
    • createEvent

      @NotNull protected @NotNull SentryEvent createEvent(@NotNull @NotNull ch.qos.logback.classic.spi.ILoggingEvent loggingEvent)
      Creates SentryEvent from Logback's ILoggingEvent.
      Parameters:
      loggingEvent - the logback event
      Returns:
      the sentry event
    • createBreadcrumb

      @NotNull protected @NotNull Breadcrumb createBreadcrumb(@NotNull @NotNull ch.qos.logback.classic.spi.ILoggingEvent loggingEvent)
      Creates Breadcrumb from Logback's ILoggingEvent.
      Parameters:
      loggingEvent - the logback event
      Returns:
      the sentry breadcrumb
    • setOptions

      public void setOptions(@Nullable @Nullable SentryOptions options)
    • setMinimumBreadcrumbLevel

      public void setMinimumBreadcrumbLevel(@Nullable @Nullable ch.qos.logback.classic.Level minimumBreadcrumbLevel)
    • getMinimumBreadcrumbLevel

      @NotNull public @NotNull ch.qos.logback.classic.Level getMinimumBreadcrumbLevel()
    • setMinimumEventLevel

      public void setMinimumEventLevel(@Nullable @Nullable ch.qos.logback.classic.Level minimumEventLevel)
    • getMinimumEventLevel

      @NotNull public @NotNull ch.qos.logback.classic.Level getMinimumEventLevel()
    • setEncoder

      public void setEncoder(ch.qos.logback.core.encoder.Encoder<ch.qos.logback.classic.spi.ILoggingEvent> encoder)