Handle exception when logging external IP