Optimize logging