Skip to content

Concurrency Issues with Multi-Isolate Logging to a Single File #93

@florianguyot

Description

@florianguyot

Hi,

I am working with your logger package, using a multi-output setup: ConsoleOutput + AdvancedFileOutput. My application uses multiple long-lived isolates, each setting up a logger that points to the same file output to maintain the chronology of logs.

While this setup works fine for the ConsoleOutput, logs in the FileOutput are not always populated completely (or are partially written). This issue generally occurs when a heavy log is passed or when many log events are generated across multiple isolates.
If I log into different files, there is no data loss. It seems to be caused by concurrent calls. However, the solution of having multiple log files makes analysis difficult later on, as you need to switch between multiple files to reconstitute the event.

I understand the limitations of concurrency when sharing the same resource across isolates. I wanted to check if you have experience with a setup or architecture where multiple isolates write logs into a single file.

Thanks,

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