This guide will…
##Log File Code Template##
capture log close local date : di %tdCY-N-D date(c(current_date), "DMY") local logfile "$logs/visit_regs_`date'.log" log using "`logfile'", replace text