Log Exception correctly