Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rushmorem opened this issue Oct 21, 2017 · 3 comments
Closed

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

rushmorem opened this issue Oct 21, 2017 · 3 comments

Comments

@rushmorem
Copy link

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
Copy link
Contributor

dpc commented Oct 21, 2017

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
Copy link
Author

I see. Thanks for the explanation.

@Mem2019
Copy link

Mem2019 commented Nov 19, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants