Skip to content

[internal-logging] flush to disk after every write #4261

Closed
@lachmatt

Description

@lachmatt

Bug Report

Symptom

Currently, flush to disk is called after every write when FileSink is used. This is inefficient and not needed.

FileSink with flush to disk after write was initially used in Loader, where logging volume was low and flushing to disk after write made sense. It was later reused for logging in other places.

Autoinstrumentation usually logs at startup (e.g. default log level of info, no warnings/errors), so inefficiency in logger will increase the startup time (I counted 16 calls in default configuration based on a quick smoke test).
Problem will be more severe when debug log level is used, when additional events from SDK event source are logged to a file (e.g. related to activity starting/stopping).

Possible solution

Explicit flush to disk could instead be ran periodically, e.g. as in Serilog's code.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

Done/Cut

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions