@@ -48,11 +48,11 @@ is_enabled() ->
48
48
lists :member (? NODES_TO_BLOCK , ets :all ()).
49
49
50
50
allow (Node ) ->
51
- error_logger : info_msg (" (~s ) Allowing distribution between ~s and ~s~n " ,
51
+ rabbit_log : warning (" (~s ) Allowing distribution between ~s and ~s~n " ,
52
52
[? MODULE , node (), Node ]),
53
53
true = ets :delete (? NODES_TO_BLOCK , Node ).
54
54
block (Node ) ->
55
- error_logger : info_msg (" (~s ) BLOCKING distribution between ~s and ~s~n " ,
55
+ rabbit_log : warning (" (~s ) BLOCKING distribution between ~s and ~s~n " ,
56
56
[? MODULE , node (), Node ]),
57
57
true = ets :insert (? NODES_TO_BLOCK , {Node , block }).
58
58
@@ -82,6 +82,9 @@ error_handler(Thunk) ->
82
82
go (Parent , Port , ProxyPort ) ->
83
83
ets :new (? NODES_TO_BLOCK , [public , named_table ]),
84
84
ets :new (? NODES_BLOCKED , [public , named_table ]),
85
+ rabbit_log :info (
86
+ " (~s ) Listening on proxy port ~p~n " ,
87
+ [? MODULE , ProxyPort ]),
85
88
{ok , Sock } = gen_tcp :listen (ProxyPort , [inet ,
86
89
{reuseaddr , true }]),
87
90
Parent ! ready ,
@@ -95,8 +98,12 @@ accept_loop(ListenSock, Port) ->
95
98
96
99
run_it (SockIn , Port ) ->
97
100
case {inet :peername (SockIn ), inet :sockname (SockIn )} of
98
- {{ok , {_Addr , SrcPort }}, {ok , {Addr , _OtherPort }}} ->
101
+ {{ok , {_Addr , SrcPort }}, {ok , {Addr , OtherPort }}} ->
99
102
{ok , Remote , This } = inet_tcp_proxy_manager :lookup (SrcPort ),
103
+ rabbit_log :info (
104
+ " (~s ) => Incoming proxied connection from node ~s (port ~b ) "
105
+ " to node ~s (port ~b )~n " ,
106
+ [? MODULE , Remote , SrcPort , This , OtherPort ]),
100
107
case node () of
101
108
This -> ok ;
102
109
_ -> exit ({not_me , node (), This })
@@ -134,6 +141,9 @@ run_loop(Sockets, RemoteNode, Buf0) ->
134
141
true -> run_loop (Sockets , RemoteNode , Buf )
135
142
end ;
136
143
{tcp_closed , Sock } ->
144
+ rabbit_log :info (
145
+ " (~s ) Distribution closed between ~s and ~s~n " ,
146
+ [? MODULE , node (), RemoteNode ]),
137
147
gen_tcp :close (other (Sock , Sockets ));
138
148
X ->
139
149
exit ({weirdness , X })
0 commit comments