Optimize log performance