@@ -307,36 +307,6 @@ configure_syslog_error_logger() ->
307307 _ -> ok
308308 end .
309309
310- - define (SYSLOG_LOCAL_IP , {ip ,{127 ,0 ,0 ,1 }}).
311- configure_syslog () ->
312- ok = app_utils :load_applications ([syslog ]),
313- % % https://github.com/schlagert/syslog#configuration
314- Protocol = case application :get_env (syslog , protocol ) of
315- undefined ->
316- {rfc3164 , udp , [? SYSLOG_LOCAL_IP ]};
317- % % {protocol,
318- % % rfc3164 |
319- % % rfc5424 |
320- % % {rfc3164 | rfc5424, tcp | udp} |
321- % % {rfc3164 | rfc5424, udp, [gen_udp:option()]} |
322- % % {rfc3164 | rfc5424, tcp, [gen_tcp:option()]} |
323- % % {rfc5424, tls, [ssl:connect_option()]}
324- % % }
325- {ok , Rfc } when Rfc =:= rfc3164 ; Rfc =:= rfc5424 ->
326- {Rfc , udp , [? SYSLOG_LOCAL_IP ]};
327- {ok , {Rfc , Transport }} when Rfc =:= rfc3164 ; Rfc =:= rfc5424 ->
328- {Rfc , Transport , [? SYSLOG_LOCAL_IP ]};
329- {ok , {Rfc , Transport , Opts }} when Rfc =:= rfc3164 ; Rfc =:= rfc5424 ->
330- case proplists :lookup (ip , Opts ) of
331- none ->
332- {Rfc , Transport , [? SYSLOG_LOCAL_IP |Opts ]};
333- _ ->
334- {Rfc , Transport , Opts }
335- end
336- end ,
337- ok = application :unset_env (syslog , protocol ),
338- ok = application :set_env (syslog , protocol , Protocol ).
339-
340310remove_rabbit_handlers (Handlers , FormerHandlers ) ->
341311 lists :filter (fun (Handler ) ->
342312 not lists :member (Handler , FormerHandlers )
@@ -380,7 +350,7 @@ lager_backend(exchange) -> lager_exchange_backend.
380350generate_handler (syslog_lager_backend , HandlerConfig ) ->
381351 DefaultConfigVal = default_config_value (level ),
382352 Level = proplists :get_value (level , HandlerConfig , DefaultConfigVal ),
383- ok = configure_syslog ( ),
353+ ok = app_utils : load_applications ([ syslog ] ),
384354 [{syslog_lager_backend ,
385355 [Level ,
386356 {},
0 commit comments