slog-rs / async

Asynchronous drain for slog-rs v2
Apache License 2.0
28 stars 24 forks source link

slog-async: logger dropped messages due to channel overflow #4

Closed rushmorem closed 7 years ago

rushmorem commented 7 years ago

I'm seeing error messages like "ERRO slog-async: logger dropped messages due to channel overflow, count: 15" in my logs. Should I be worried?

dpc commented 7 years ago

You are logging faster than your backend can write the logs to the output. The buffer (channel) got full, and slog had to drop couple of logging messages (15).

You have to decide what to do about it. You can eg. increase the size of the buffer: https://docs.rs/slog-async/2.1.0/slog_async/struct.AsyncBuilder.html#method.chan_size which would help if these are just temporary bursts of logs.

You could ignore the problem, and maybe even filter out the messages about it.

Or you could not use async logging, make your app wait every time a message is logged, until it actually hits a disk/network or something.

rushmorem commented 7 years ago

I see. Thanks for the explanation.

Mem2019 commented 1 year ago

For anyone who searches the problem, TerminalLoggerBuilder::new().overflow_strategy(OverflowStrategy::Block) solves it.