Improve log performance