Added ability to log to file.