Added support for logging to file