This gist demonstrates how to setup logging and write to both standard-error and a file.
Output is printed to stderr as well as a file. For example:
$ python logger.py
2020-02-19 11:46:59,473: WARNING: __main__: Starting to do stuff...
2020-02-19 11:47:01,480: INFO: __main__: Stuff done!