Add robust logging