2016-08-01 79 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