add log and begin template