code: public static SentryAppender addSentryAppender(final String dsn, Level logLevelThreshold) {
      final Logger rootLogger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
  
      final LoggerContext context = rootLogger.getLoggerContext();
  
      SentryAppender appender = new SentryAppender();
      appender.setDsn(dsn);
  
      appender.setContext(context);
      ThresholdFilter levelFilter = new ThresholdFilter();
      levelFilter.setLevel(logLevelThreshold.logbackLevel.toString());
      levelFilter.start();
      appender.addFilter(levelFilter);
  
      appender.start();
  
      rootLogger.addAppender(appender);
  
      return appender;
    }
docs: Add a sentry appender.
  @param dsn the sentry dsn to use (as produced by the sentry webinterface).
  @param logLevelThreshold the threshold for log events to be sent to sentry.
  @return the configured sentry appender.