log file generation code added