Properly log exception