Erlang: printing loaded sys.config in OTP application
How do I show the absolute path from which my Erlang OTP app is loaded sys.config
? That is, if get_all_env
( http://erlang.org/doc/apps/kernel/application.html#get_all_env-0 ) shows unexpected results, how can I see which file is being loaded for debugging?
I did it once, so I know it is possible, but unfortunately I cannot find this code = (
+3
source to share
1 answer
You can use init: get_plain_arguments / 0 to get the full list of VM arguments:
(node@localhost)13> init:get_plain_arguments().
["/usr/local/bin/rebar3","shell","--apps","some_app",
"--config","priv/sys.config","--sname","node1@localhost"]
This certainly works if you started node manually in the CLI. For reference, the output above matches my running script with rebar3 :
rebar3 shell --apps some_app --config priv/sys.config --sname node1@localhost
+1
source to share