Added support for log output to .txt file