Writes template file before adding logentry