On 2018-01-09 14:46, Apache <ralph.go...@dslextreme.com> wrote: 
> The Logging api only allows you to log a single event at a time so it 
> doesn’t make sense for an appender to have a method that accepts multiple 
> events since it can’t happen. That said, appenders can queue the events and 
> send them downstream in batches. I believe some of the appenders do that now.
> 
> Is there some use case I am not aware of where this method could be called?

Hi, Ralph,

my trivial guess would be, that the AsyncAppender somewhere has code like this:

   void pushToBackend(LogEvent[] events) {
     Appender backend = syncAppender;
     for (LogEvent ev : events) {
       backend.append(ev);
     }
   }

which might be changed to

   void pushToBackend(LogEvent[] events) {
     Appender backend = syncAppender;
     if (backend instanceof BatchableAppender) {
       ((BatchableAppender) backend).append(events);
     } else {
       for (LogEvent ev : events) {
         backend.append(ev);
       }
     }
   }

Thus, if my Appender implements BatchableAppender (with the additional method), 
then I could have what I wanted without any changes in my code.

Jochen

Reply via email to