Performance improvements to logging