Log4j2 AsycLogger Implementation with a database appender has an issue.
As i investigated the async logger mechanism works like that.
Messages are put into DistruptorRingBuffer
RingBufferLogEventHandler's onEvent mehtod is called and message is passed to appender asyncronously.
In AbstractDatabaseAppender case
The messages also put into an ArrayList to make batches for bulk insert to table.
Than Abstract Database Manager puts LogEvent into ArrayList
After that correspoding LogEvent object can be re-used in the DistruptorRingBuffer mechanism.
When a delay happens in the database the LogEvent objects are overriden with same referance which causes inconsitency while preparing batches.
I believe this points to a bug or design problem.
I would like to contribute solution if anyone can guide where to start what might be the possible design.