[erlang-questions] OTP node config file: set global Vars in node config

Serge Aleynikov saleyn@REDACTED
Thu Feb 21 14:09:02 CET 2008

There's only one repository of configuration data in OTP maintained by 
the application_controller on per-application basis.  However, you can 
always use file:consult/1 call to have custom configuration read from a 
file.  The question is then which OTP application would be responsible 
for loading that config data from file?  Once you create such an 
application, you may as well stick to the standard OTP application 
behavior and use application:get_env/2 for that purpose.

The only exception I recall being when we had a need to implement 
something custom on that front was to load application configuration 
data and convert it into a compiled bytecode so that key/value lookups 
would work faster.


db wrote:
> anyone knows how I can define global config parameters without specifying
> the application and how do I access this global node config Vars inside the
> code?
> application:get_env, gets the environment vars for the application. What if
> I wanted to get environment vars, global to the node(all application)?
> If the above is not possible, and I specify config tuple {myapp, [{Var,
> Val}]}.  Does it mean I have to start the myapp application to access these
> myapp specific Vars, in erl shell?
> thank you,

More information about the erlang-questions mailing list