Output to file added. TODO: add log file path into configuration.