In order to keep the log file in the same directory as the .py file, the logfile definition should read: logging.basicConfig(filename=_dir + '/rwsheet.log', level=logging.INFO)