Fix for writing template and log chunk after rolling log file