Added log file creation feature to main.c master