Adjust the method to record log.