Add some logging for easier diagnosis in NetUtil

.. + formatting