log optimization