Skip to content

[AsyncFileHandler] Refine behavior of timer task #72

@marcdumais-work

Description

@marcdumais-work

Feature Description:

At the time of writing this, the timer task in AsyncFileHandler flushes the current event buffer to the writer's queue periodically (as per config - default every 1000ms). This ensures that even if the logging intensity is low and/or the buffer big, log records will find their way in the trace log without having to wait too long.

However, in the cases where log intensity may be high (and/or the buffer small), the timer task might trigger the buffer being flushed to the writer's queue more than necessary, e.g. soon after it was flushed after reaching its maximum size. This seems sub-optimal.

Ultimately, the behavior will still depend on the config - the buffer size, the flush period, as well as how much logging is happening in the application using the handler. But it would be easier to keep the desirable behavior and prevent the undesirable one, if, e.g. the timer task was re-set or cancelled and then recreated, every time the buffer is flushed because its max size was reached.

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