log better during errors