Skip to content

Increase observability of AsyncAppender #942

@ikurovsky

Description

@ikurovsky

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions