When running the release beside my logging files configured with filters in logger, there is one more file erlang.log.X generated by run_erl (Erlang -- run_erl)
Seems in this file all the logs are written no matter what level info I have in logger default handler .
How can I disable this as it’s pointless and only consume disk space for nothing.
True… but how you do this with logger … the default handle in my case is the one that sends the logs to console and the level is set to critical. No logs are displayed while in this file I see logs with info level…
Only solution I found was to delete the default handler (in my case the one that is logging to stdout). Seems for some reason the run_erl is not taking into account the log level set for the handler.
The systemd unit file you’ve shown calls app_name start, which uses run_erl to have your release run as an old-school background daemon indeed. With systemd, it’s preferable to call app_name foreground instead, and to set Type=exec rather than Type=forking. This gives systemd better control over the service process(es), including the logging of output written to stdout (and stderr). You can also omit the PIDFile option then.
By the way, recent Rebar3 versions renamed the start argument to daemon (and recommend using foreground instead, if possible), precisely to clarify this difference.