logfile template and port generation