Whence data.<node_name>@localhost directories?

Which application produces local data.<node_name>@localhost and log.<node_name>@localhost directories in project root? lager? Where is this behavior configured? I was only expecting to see logs in the console, given config :logger, :console, format: "[$level] $message\n" in dev.exs.

I now realise these two (empty) directories, data.<node_name>@localhost and log.<node_name>@localhost, are created when the app can’t boot; f.e. when the Phoenix port is already in-use (** (EXIT) {:listen_error, MyAppWeb.Endpoint.HTTP, :eaddrinuse}).

Do you know how to turn off this behaviour? Setting ERL_CRASH_DUMP=/dev/null doesn’t prevent the creation of these dirs, neither does ERL_CRASH_DUMP_BYTES=0.

I stumbled upon this thread when investigating a similar problem. In my case, I found that my project was pulling setup - GitHub as a dependency.

setup can be configured with log_dir and a data_dir config options, but the default behavior is data.<node_name>@localhost and log.<node_name>@localhost as you described in your post.

I suggest looking into the configuration options of the setup app. For me, I just added the following to my config:

config :setup,
  data_dir: "my_data_dir",
  log_dir: "my_log_dir"
1 Like