Skip to content

Add a log message when the logger enters burst protection mode #8852

Open
@PragTob

Description

@PragTob

Hi, it's me - logger documentation PR barrage guy 😅

Is your feature request related to a problem? Please describe.
I recently spent a lot of time trying to debug why our system had seemingly swallowed log messages. First of course I thought the application was broken for real.
Anyhow, after reading the logger docs I figured we'd likely either hit :drop or :flush mode or maybe even the burst mode protection. I figured we hit drop mode (see #8849 ), but I was unsure if we had hit "burst protection mode". There is no log message that I'm aware of (checked the code) or any other way I could directly know that burst protection mode was turned on. So, I turned it off and hoped that this was it - but having the certainty before would have been good. As well as a way that I could have seen it while perusing the logs.

Describe the solution you'd like
I'd like there to be a log emitted when burst mode protection is entered. I know it's one more log event to emit in an already high stress situation for the logger but I think the tradeoff is worth it.

I think it's also in line with a log message being emitted when :drop mode is entered.

Something like: Logger :default is entering burst protecting mode, dropping logs

Describe alternatives you've considered

  • keep as is - possible, but I think this is better for the reasons above
  • other notification mechanism - maybe a log message isn't the right mechanism? I have thought of telemetry but I don't think we want OTP to depend on it. We might also just set a piece of state in the logger itself so that you could ask the logger like "hey, have you encountered burst mode?" and maybe it'd be visible in observer. Unsure where we'd do that, though. I also think that logging that information is more natural - as when you're debugging the logs you are likely already in the logs and so you might stumble upon that message, helping you. Like, I'm sure I went through more than 500 log messages and so encountering that message would have immensely helped me figuring out what's wrong.

Additional context
Thank you for all your work on erlang and the new logger 💚

Metadata

Metadata

Assignees

Labels

enhancementhelp wantedIssue not worked on by OTP; help wanted from the communityteam:VMAssigned to OTP team VM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions