Add log_file argument

Simple patch to allow logging to a file