code-anth
Do OTP logger handlers have overloading protection or not?
Hiya. I’m trying to switch from LoggerFileBackend to Erlang/OTP Handlers for logging. In the Elixir Logger docs, it says:
At the moment, there is no built-in overload protection for Erlang handlers, so it is your responsibility to implement it.
However, in the Erland docs it says:
The default handlers, logger_std_h and logger_disk_log_h, feature an overload protection mechanism, which makes it possible for the handlers to survive, and stay responsive, during periods of high load (when huge numbers of incoming log requests must be handled)
This sounds a bit ambiguous to me. Would anyone be able to clarify this?
Thanks!
Most Liked
hubertlepicki
Well, yes, overload protection and ensuring the handlers survive is one thing, the other thing is how the system behaves and if it survives when the output of logs exceedes the capacity to process them.
Logger has several options to handle that situation, the ones you may want to tweak are :sync_threshold, :discard_threshold and :max_buffer.
Basically we had situation where logger was switching to sync mode, and stayed in it too long, the I/O was stuck and we just decided never to do it because the whole system would freeze, and switched to discard mode instead of ever hitting sync mode was the best option for us.
D4no0
The elixir library doesn’t implement overload protection, however if you use erlang logger backend, the backend will have overload protection?
Does that make sense? I am not entirely familiar with logger backends, but it seems that should be the principle.
D4no0
Yeah, the choice of wording is strange indeed, maybe there is something more to it.
It might also be that erlang did not have overloading protection back in the day when this was written down in elixir documentation, but this is just a theory.
I guess you have to wait for a elixir core member to answer.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









