optimize the logs save