erlang lager_syslog驱动程序故障



我试图在我的项目中使用lager_syslog,但似乎缺少一个驱动程序。

这是在我的rebar.conf:中

    {deps, [
       ...
       {lager_syslog, {git, "https://github.com/basho/lager_syslog.git", {branch, master}}}
    ]}.

我的测试处理程序:

    {lager_syslog_backend, ["test", local1, info]},

错误:

19:29:09.981 [error] Lager failed to install handler {lager_syslog_backend,{"test",local1}} into lager_event, retrying later : {error,
   {{shutdown,
     {failed_to_start_child,
      syslog,
      "could not load driver syslog_drv: "cannot open shared object file: No such file or directory""}},
    {syslog_app,
     start,
     [normal,
      []]}}}

有什么建议吗?

感谢Kenneth Lakin在邮件列表中回答了我的问题

IIRC,rebar3将端口编译器移到了rebar3插件中,而不是把它和核心项目结合起来。据我所见,rebar2依赖它的项目将无法加载其端口驱动程序。

添加

{overrides,
  [{override, syslog, [
    {plugins, [pc]},
    {artifacts, ["priv/syslog_drv.so"]},
    {provider_hooks, [
      {post,
        [
        {compile, {pc, compile}},
        {clean, {pc, clean}}
        ]
      }]
    }
  ]}
]}.

到项目中的rebar.conf,清除并重新生成。(系统日志项目是lager_syslog的端口驱动程序所在的位置。)

另请参阅:https://github.com/blt/port_compiler#use-具有现有的依赖

最新更新