protected void logThresholdExceededAlerts(List<GatewaySenderEventImpl> events) {
    // Log an alert for each event if necessary
    if (getSender().getAlertThreshold() > 0) {
      long currentTime = System.currentTimeMillis();
      for (GatewaySenderEventImpl event : events) {
        try {
          if (event.getCreationTime() + getSender().getAlertThreshold() < currentTime) {
            logger.warn(
                "{} event for region={} key={} value={} was in the queue for {} milliseconds",
                new Object[] {event.getOperation(), event.getRegionPath(), event.getKey(),
                    event.getValueAsString(true), currentTime - event.getCreationTime()});
            getSender().getStatistics().incEventsExceedingAlertThreshold();
          }
        } catch (Exception e) {
          logger.warn("Caught the following exception attempting to log threshold exceeded alert:",
              e);
          getSender().getStatistics().incEventsExceedingAlertThreshold();
        }
      }
    }
  }
In case of BatchException we expect that the dispatcher has removed all the events till the
event that threw BatchException.
geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySenderEventProcessor.java