Add logging for exceptions during login