Handle templog file properly to write and read contents

Ticket:	#4553