Added ability to log output to file