Hello everyone,
I’ve recently upgraded my project to Elixir 1.15 and encountered issues with capturing logs from supervisor child process terminations. Before the upgrade, everything was working as expected. Below are the relevant code excerpts and setup details:
Environment:
- Erlang version: 25.2
- Previous Elixir version: 1.14.5 (working correctly)
- Current Elixir version: >=1.15 (issue present)
Code structure:
- Logger Handler module:
defmodule MyApp.LoggerHandler do
def log(%{msg: {:report, %{label: {:supervisor, :child_terminated}, report: report}}}, _config) do
IO.inspect("Child terminated")
end
def log(_log_event, _config) do
:ok
end
end
- Logger Handler usage in application.ex:
:ok = :logger.add_handler(:my_app_logger_handler, MyApp.LoggerHandler, %{})
Issue Description:
After upgrading to Elixir 1.15, the logs for supervisor child process terminations are not being captured as expected. Specifically, the log/2 function in MyApp.LoggerHandler is not triggered for :child_terminated events.
Troubleshooting Steps:
- Verified that the
log/2
function is correctly defined and matches the expected event structure (as per SASL Error Logging — sasl v4.2.2).
Questions:
- Has anyone else encountered similar issues after upgrading to Elixir 1.15?
- Are there any known issues or changes in Elixir 1.15 that might affect the capture of supervisor child process termination events?
- Has the structure or content of the log events for supervisor child terminations changed in Elixir 1.15? If so, what should I be looking for?
- Are there any changes in how :telemetry or other instrumentation tools interact with supervisor events in Elixir 1.15?
Any insights, suggestions, or potential solutions would be greatly appreciated. Thank you in advance for your help!