From da1ca8bff59fd63f41f48abb1e9c43d6f7f31bcb Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Pedron Date: Thu, 8 Jan 2015 15:00:49 +0100 Subject: Do not log the real connection timestamp Also, remove the "incoming connection" message. Both informations don't have much value. --- src/rabbit_misc.erl | 8 +------- src/rabbit_reader.erl | 10 ++-------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index e318f3f7..3e2c88ee 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -69,7 +69,7 @@ -export([get_parent/0]). -export([store_proc_name/1, store_proc_name/2]). -export([moving_average/4]). --export([now_to_ms/1, ms_to_now/1]). +-export([now_to_ms/1]). %% Horrible macro to use in guards -define(IS_BENIGN_EXIT(R), @@ -988,12 +988,6 @@ term_to_json(V) when is_binary(V) orelse is_number(V) orelse V =:= null orelse now_to_ms({Mega, Sec, Micro}) -> (Mega * 1000000 * 1000000 + Sec * 1000000 + Micro) div 1000. -ms_to_now(Ms) -> - Mega = Ms div 1000 div 1000000, - Sec = Ms div 1000 - Mega * 1000000, - Micro = (Ms - Mega * 1000 * 1000000 - Sec * 1000) * 1000, - {Mega, Sec, Micro}. - check_expiry(N) when N < 0 -> {error, {value_negative, N}}; check_expiry(_N) -> ok. diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index 21c0abd5..192628c0 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -214,7 +214,6 @@ start_connection(Parent, HelperSup, Deb, Sock, SockTransform) -> rabbit_net:fast_close(Sock), exit(normal) end, - log(debug, "incoming connection ~p (~s)~n", [self(), Name]), {ok, HandshakeTimeout} = application:get_env(rabbit, handshake_timeout), ClientSock = socket_op(Sock, SockTransform), erlang:send_after(HandshakeTimeout, self(), handshake_timeout), @@ -328,16 +327,11 @@ mainloop(Deb, Buf, BufLen, State = #v1{sock = Sock, %% %% The goal is to not log TCP healthchecks (a connection %% with no data received) unless specified otherwise. - Now = rabbit_misc:ms_to_now(ConnectionTime), - {{Year, Month, Day}, {Hour, Min, Sec}} = - calendar:now_to_local_time(Now), log(case Recv of closed -> debug; _ -> info - end, "accepting AMQP connection ~p (~s)~n" - "(opened at ~b-~2..0b-~2..0b::~2..0b:~2..0b:~2..0b)~n", - [self(), ConnName, Year, Month, Day, - Hour, Min, Sec]); + end, "accepting AMQP connection ~p (~s)~n", + [self(), ConnName]); _ -> ok end, -- cgit v1.2.1