Improvements to logging