Modified the logging code. Now it stores logs into actual log files as well as to output.