added ability to log to file