optimize logging