[erlang-questions] Environment variables for release

Ulf Wiger ulf@REDACTED
Mon Jan 7 16:36:08 CET 2013


One suggestion:

The application lib must be loaded before get_env() can work.

BR,
Ulf W

On 7 Jan 2013, at 15:15, AD wrote:

> Hello,
> 
>  I have a library being built that is leveraging environment variables.  There is a line in the library include file that looks like
> 
> -define(CONST, lib:get_env(Key,Default)).
> 
> the lib:get_env function simply checks
> 
>     application:get_env(lib, Key) % in order to check the library.app first
>  and then
>    application:get_env(Key) % check for local overrides 
> 
>  However when i place variables like the following in the main example.app file in ebin/
> 
> {application,example,
>              [{description,[]},
>               {env,[{'COWBOY_HTTP_PORT',9090}]},
>               ......
> 
> Nothing is getting read.  I am not sure if this needs to be in rel/files/app.config instead?
> 
> Appreciate any help here.
> 
> -AD
> 
>  
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
http://feuerlabs.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130107/110b3e48/attachment.htm>


More information about the erlang-questions mailing list