Skip to content

Structured Logs: Buffering & flushing of logs #5580

@denrase

Description

@denrase

Implement buffering & flushing of logs

Rough overview how it should work:

Buffer: Can hold a maximum of 100 logs at once

  • A queue might be preferrable here

Flush Triggers:

  • Idle Timeout: After capturing a log, a 5-second idle timeout is set. If no new logs are captured during this period, the buffer is flushed.
    • Each new log resets the idle timeout
  • Visibility Change: When the app becomes hidden / goes into background logs are immediately flushed to ensure data isn't lost.
  • Buffer Size Limit Reached: when buffer exceeds 100 logs, it's automatically flushed.
    • If you add 101 logs, the SDK will flush at the 100th, the other logs will after flushing then be added to an empty buffer (data isn't lost)

Add context

Metadata

Metadata

Assignees

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