-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
In certain real world scenarios AsyncAppender requires some subtle tuning.
A typical one in our apps is providing additional metrics i.e. making a "monitorable" AsyncAppender. Aside from the queue size (which is already provided) we need the following:
- Number of appended log events
- Number of discarded log events
In current implementation, making such a customization requires workarounds as internal blocking queue is package private and there are no callbacks on appropriate events.
It seems reasonable to provide a couple of protected methods, so that derived classes could handle them according to their needs. An event listener would also work well.
Another variant is just to provide such counters out of box and publish them in public methods, similar to getNumberOfElementsInQueue(), but it would mean enforcing additional calculations even when it's not needed by the app.