Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1797

Add asynchronous/non-blocking SPIs for appenders

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Appenders
    • Labels:
      None

      Description

      Some appenders (e.g., Kafka and Cassandra) support using an asynchronous SPI with callbacks (to make them non-blocking). In a Scala-based API, this could be easily handled with the Future class, and with Java 8, this could be easily handled with a CompleteableFuture class. However, if this API improvement is desired for Java 7, then we'd need to create a basic callback API that would ideally be easy to update to CompleteableFuture later on.

      In theory, such an SPI could also be adapted to use the Flow classes in Java 9. This may be an interesting API to follow as we could use the Reactive Streams standard API or a compatible API.

      Some main things that would be desirable in such an SPI would include asynchronous error handling (e.g., to trigger a failover appender). This should be adapted to work well with the generic AsyncAppender and AsyncLogger as well.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mattsicker Matt Sicker
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: