【问题标题】:Erlang; OTP application "app.config"二郎; OTP 应用程序“app.config”
【发布时间】:2017-09-22 16:26:58
【问题描述】:

我有一个 OTP 应用程序。到目前为止,我有两个配置文件:rebar.configconfig/vm.args,后者在前者中引用:{vm_args, "config/vm.args"}

在较大的文档中:https://github.com/erlang-lager/lager 提到了另一个配置文件:app.config。该文件在哪里以及如何从我的钢筋配置中引用它?在 /src 或应用程序的根目录中?我问是因为我尝试在我的rebar.config 中添加lager 部分,但没有做任何事情:lager 仍在使用默认值运行。所以我可能需要这个app.config

【问题讨论】:

    标签: erlang


    【解决方案1】:

    好的,想通了。在 Rebar 中,您可以指定 sys.config: https://www.rebar3.org/docs/releases

    所以我有一个新文件 config/sys.config,我的 relx 部分现在显示:

    {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"}
       ]}.
    

    【讨论】:

      猜你喜欢
      • 2010-12-13
      • 1970-01-01
      • 2010-12-11
      • 1970-01-01
      • 1970-01-01
      • 2015-04-04
      • 2011-08-28
      • 2011-07-13
      • 1970-01-01
      相关资源
      最近更新 更多