Make async logging buffer size configurable.

Introduce the core.asyncLogginBufferSize parameter as size of the buffer
to store logging events for asynchronous logging.

Putting a larger value can protect threads from stalling when the
AsyncAppender threads are not fast enough to consume the logging events
from the buffer. It also protects from loosing log entries in this case.

In addition, instead of expected thread stall when the logging buffer is
full there is a bad side effect where an AsyncAppender-Dispatcher thread
dies which then causes all NioProcessor threads to block on
AsyncAppender.append method. Finally Gerrit stops responding on SSH
requests. The reason for AsyncAppender-Dispatcher thread death is that
it tries to discard a set of unprocessed logging events from the buffer
but throws a NPE because of trying to compute hash value on the logger
parameter of the LogginEvent which is set to null from Gerrit.  We
should probably also try to make our logging events discardable. This is
not part of this change.

Change-Id: I3fe97a7a0827293a385bf6ccb46ed2f4af53b674
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
4 files changed