Use logException for logging exceptions.