easco
Make an unhandled exception more noisy
I have a process, using gen_statem, which was crashing (and being restarted by a supervisor) because of an unhandled exception.
When I first encountered the issue while debugging it was clear that the process was restarting, but the unhandled exception didn’t cause anything to be printed to the console. It would silently fail, the supervisor would restart things, and the cycle would continue.
Tracking down the issue would have been much faster if the exception had been more “noisy”. I tried using the :debug option for my server with both “:trace” and “:log” - while it was interesting to see the system messages the exception was still silently raised and handled.
Is there something I could have done to make the unhandled exception more “noisy”, at least in dev mode, so I could have come to a resolution more swiftly?
Marked As Solved
OvermindDL1
Enable the built-in sasl app, but be warned, it will be VERY noisy. It logs all OTP process creation and crashes and so forth.
Last Post!
grzuy
For what is worth, updating this thread after 5 years.
Fortunately now (since Erlang/OTP 21) a new improved logger exists, which deprecates the sasl app.
Quote from SASL Error Logging — OTP 29.0.2 (sasl 4.4) as of today:
The SASL error logging concept described in this section is deprecated since Erlang/OTP 21.0, when the new logging API was introduced.
The new default behaviour is that the SASL application no longer affects which log events that are logged. Supervisor reports and crash reports are logged via the default logger handler which is setup by Kernel. Progress reports are by default not logged, but can be enabled by setting the primary log level to
info, for example by using the Kernel configuration parameterlogger_level.
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
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









