Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Erlang; OTP application "app.config"

Tags:

erlang

I have an OTP application. So far, I have two configuration files: rebar.config and config/vm.args, the latter of which is referenced in the former: {vm_args, "config/vm.args"}.

In the lager documentation: https://github.com/erlang-lager/lager There is mention of another configuration file: app.config. Where does this file go and how do I reference it from my rebar config? In /src or at the root of the application? I ask because I tried adding that lager section in my rebar.config and that didn't do anything: lager is still operating with the defaults. So I probably need this app.config.

like image 745
Tommy Avatar asked May 16 '26 06:05

Tommy


1 Answers

OK figured this out. In Rebar you can specify sys.config: https://www.rebar3.org/docs/releases

So I have a new file config/sys.config and my relx section now reads:

{relx, [
    {release,
        {myapp,"3.4.1"},
        [myapp]
    },
    %{extend_start_script,true},
    %
    %for the following two fancyiness see https://www.rebar3.org/docs/releases
    %Supply our own vm.args
    {vm_args, "config/vm.args"},
    %supply our own application configuration
    {sys_config, "config/sys.config"}
   ]}.
like image 70
Tommy Avatar answered May 18 '26 20:05

Tommy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!