Added logging to file support

Now logs can be saved to a file, so that we can check them later.