# erlang.log.X generated by run\_erl - how to disable?

**URL:** <https://erlangforums.com/t/erlang-log-x-generated-by-run-erl-how-to-disable/2303>\
**Category:** Questions / Help\
**Tags:** erlang-logger\
**Created:** [January 20, 2023, 11:09pm UTC](https://erlangforums.com/t/erlang-log-x-generated-by-run-erl-how-to-disable/2303 "2023-01-20T23:09:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![silviucpp](https://erlangforums.com/user_avatar/erlangforums.com/silviucpp/32/1540_2.png) [@silviucpp](https://erlangforums.com/u/silviucpp)\
**Post date:** [January 20, 2023, 11:09pm UTC](https://erlangforums.com/t/erlang-log-x-generated-by-run-erl-how-to-disable/2303/1 "2023-01-20T23:09:56Z")

</div>

Hello,

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](https://www.erlang.org/doc/man/run_erl.html))

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.

Silviu

---

<div class="post-metadata">

**Author:** ![filmor](https://erlangforums.com/user_avatar/erlangforums.com/filmor/32/988_2.png) [@filmor](https://erlangforums.com/u/filmor)\
**Post date:** [January 21, 2023, 11:46am UTC](https://erlangforums.com/t/erlang-log-x-generated-by-run-erl-how-to-disable/2303/2 "2023-01-21T11:46:56Z")

</div>

From what I can see in the documentation, you just have to make sure that your Erlang logs don’t go to `stdout`.

---

<div class="post-metadata">

**Author:** ![silviucpp](https://erlangforums.com/user_avatar/erlangforums.com/silviucpp/32/1540_2.png) [@silviucpp](https://erlangforums.com/u/silviucpp)\
**Post date:** [January 21, 2023, 9:36pm UTC](https://erlangforums.com/t/erlang-log-x-generated-by-run-erl-how-to-disable/2303/3 "2023-01-21T21:36:31Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![silviucpp](https://erlangforums.com/user_avatar/erlangforums.com/silviucpp/32/1540_2.png) [@silviucpp](https://erlangforums.com/u/silviucpp)\
**Post date:** [January 21, 2023, 10:26pm UTC](https://erlangforums.com/t/erlang-log-x-generated-by-run-erl-how-to-disable/2303/4 "2023-01-21T22:26:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![maxlapshin](https://erlangforums.com/user_avatar/erlangforums.com/maxlapshin/32/1593_2.png) [@maxlapshin](https://erlangforums.com/u/maxlapshin)\
**Post date:** [January 25, 2023, 4:52am UTC](https://erlangforums.com/t/erlang-log-x-generated-by-run-erl-how-to-disable/2303/5 "2023-01-25T04:52:34Z")

</div>

run\_erl is a poor-man systemd replacement that writes all logs on disk (synchronously!).

Why not to switch to systemd instead?

---

<div class="post-metadata">

**Author:** ![silviucpp](https://erlangforums.com/user_avatar/erlangforums.com/silviucpp/32/1540_2.png) [@silviucpp](https://erlangforums.com/u/silviucpp)\
**Post date:** [January 25, 2023, 6:52am UTC](https://erlangforums.com/t/erlang-log-x-generated-by-run-erl-how-to-disable/2303/6 "2023-01-25T06:52:27Z")

</div>

I’m not sure I understand. The application is a standard rebar3 release started via systemd:

```plaintext
[Unit]

Description="APP DESCRIPTION"
After=syslog.target network.target local-fs.target

[Service]

Type=forking
NotifyAccess=main
LimitNOFILE=120000
PIDFile=/app_path/app.pid
LimitCORE=infinity
Restart=on-failure
TimeoutStartSec=300s
RestartSec=5s
WatchdogSec=120

Environment="HOME=/app_path/"
Environment="ERLANG_PID_FILE_PATH=/app_path/app.pid"
Environment="CODE_LOADING_MODE=interactive"

ExecStart=/app_path/bin/app_name start
ExecStop=/app_path/bin/app_name stop

[Install]
WantedBy=multi-user.target

```

---

<div class="post-metadata">

**Author:** ![holger](https://erlangforums.com/user_avatar/erlangforums.com/holger/32/831_2.png) [@holger](https://erlangforums.com/u/holger)\
**Post date:** [January 25, 2023, 1:08pm UTC](https://erlangforums.com/t/erlang-log-x-generated-by-run-erl-how-to-disable/2303/7 "2023-01-25T13:08:46Z")

</div>

> [@silviucpp](#):
>
> The application is a standard rebar3 release started via systemd

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.

---

<div class="post-metadata">

**Author:** ![silviucpp](https://erlangforums.com/user_avatar/erlangforums.com/silviucpp/32/1540_2.png) [@silviucpp](https://erlangforums.com/u/silviucpp)\
**Post date:** [January 25, 2023, 1:49pm UTC](https://erlangforums.com/t/erlang-log-x-generated-by-run-erl-how-to-disable/2303/8 "2023-01-25T13:49:47Z")

</div>

Thanks a lot for your clarifications. I will follow your suggestions !

Silviu
