add functionality of logging to file