summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_error_logger.erl17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/rabbit_error_logger.erl b/src/rabbit_error_logger.erl
index d847284243..3724b95e9d 100644
--- a/src/rabbit_error_logger.erl
+++ b/src/rabbit_error_logger.erl
@@ -69,7 +69,7 @@ init([DefaultVHost]) ->
name = ?LOG_EXCH_NAME}}.
terminate(_Arg, _State) ->
- terminated_ok.
+ ok.
code_change(_OldVsn, State, _Extra) ->
{ok, State}.
@@ -105,10 +105,11 @@ publish1(RoutingKey, Format, Data, LogExch) ->
Args = [truncate:term(A, ?LOG_TRUNC) || A <- Data],
Headers = [{<<"node">>, longstr, list_to_binary(atom_to_list(node()))}],
- {ok, _DeliveredQPids} =
- rabbit_basic:publish(LogExch, RoutingKey,
- #'P_basic'{content_type = <<"text/plain">>,
- timestamp = Timestamp,
- headers = Headers},
- list_to_binary(io_lib:format(Format, Args))),
- ok.
+ case rabbit_basic:publish(LogExch, RoutingKey,
+ #'P_basic'{content_type = <<"text/plain">>,
+ timestamp = Timestamp,
+ headers = Headers},
+ list_to_binary(io_lib:format(Format, Args))) of
+ {ok, _QPids} -> ok;
+ {error, _Err} -> ok
+ end.