render template to file and add logging mode