2016-08-01 53 views
0

我试图在我的项目中使用lager_syslog,但它看起来像一个驱动程序丢失。erlang 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, 
     []]}}} 

什么建议吗?

回答

1

感谢肯尼斯·莱金谁在邮件列表

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-with-existing-dependency