Log optimization