More robust logging, little tweak on the procedure.