Some logging improvement