summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2015-03-24 15:58:25 +0100
committerJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2015-03-24 15:58:25 +0100
commit619e58245f9d912fe7db915cbb2097483c6cb72f (patch)
tree15d4beedcc7d93e3c16bc72cfa0cc135645f9228 /src
parent8114304057647986ed212658657dc2f2d51b488b (diff)
downloadrabbitmq-server-git-619e58245f9d912fe7db915cbb2097483c6cb72f.tar.gz
Add 'channel' as a new log category
For instance, one can use the following configuration to disable messages related to channels: [ {rabbit, [ {log_levels, [{channel, none}]} ]} ]. References #74.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_channel.erl10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index 63a5eb7e79..4e2a9e11f7 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -484,6 +484,8 @@ format_message_queue(Opt, MQ) -> rabbit_misc:format_message_queue(Opt, MQ).
%%---------------------------------------------------------------------------
+log(Level, Fmt, Args) -> rabbit_log:log(channel, Level, Fmt, Args).
+
reply(Reply, NewState) -> {reply, Reply, next_state(NewState), hibernate}.
noreply(NewState) -> {noreply, next_state(NewState), hibernate}.
@@ -520,10 +522,10 @@ handle_exception(Reason, State = #ch{protocol = Protocol,
{_Result, State1} = notify_queues(State),
case rabbit_binary_generator:map_exception(Channel, Reason, Protocol) of
{Channel, CloseMethod} ->
- rabbit_log:error("Channel error on connection ~p (~s, vhost: '~s',"
- " user: '~s'), channel ~p:~n~p~n",
- [ConnPid, ConnName, VHost, User#user.username,
- Channel, Reason]),
+ log(error, "Channel error on connection ~p (~s, vhost: '~s',"
+ " user: '~s'), channel ~p:~n~p~n",
+ [ConnPid, ConnName, VHost, User#user.username,
+ Channel, Reason]),
ok = rabbit_writer:send_command(WriterPid, CloseMethod),
{noreply, State1};
{0, _} ->