add some improvements for logging