anchor.diff:                  ok ->
                       ok;
                   _Err ->
  -                    io:format("logplex_drain_writer app_id=~p channel_id=~p tcp=true event=send error=~100p~n", [AppId, ChannelId, _Err]),
  +                    io:format("logplex_drain_writer app_id=~p channel_id=~p writer=~p host=~s port=~w tcp=true event=send error=~100p~n", [AppId, ChannelId, self(), Host, Port, _Err]),
                       ets:delete(drain_sockets, {Host, Port}),
                       send_packet(true, _UdpSocket, AppId, ChannelId, Host, Port, Packet, Count-1)
               end;
  
positive.code:             case (timer:now_diff(erlang:now(), Time) div 1000000) > 5 of
                  %% if so, retry connect
                  true ->
                      io:format("logplex_drain_writer app_id=~p channel_id=~p event=socklookup result=error~n", [AppId, ChannelId]),
                      ets:delete(drain_sockets, {Host, Port}),
                      tcp_socket(AppId, ChannelId, Host, Port);
                  false ->
  
negative.code:             io:format("nxdomin ~s:~w~n", [Host, Port]),
              {error, nxdomain};
          Err ->
              io:format("logplex_drain_writer app_id=~p channel_id=~p writer=~p host=~s port=~w tcp=false event=send error=~100p~n", [AppId, ChannelId, self(), Host, Port, Err]),
              exit(Err)
      end.
  
  