Here is a snippet of how logging is done in my test script: logging.basicConfig( level=logging.INFO, format="%(asctime)s %(message)s", datefmt="%Y%m%d %H:%M:%S", handlers=[ logging.FileHandler(args.log_file), logging.StreamHandler() ] ) logger = logging.getLogger() Path(args.log_file).chmod(0o644) logger.info("this_is_a_test") When the testcase is finished running, the log file is created, but there is nothing in it: -rw-r--r-- 1 root root 0 Nov 30 12:50 /u/qiang/logs/mytest/01_test_with_simulator/001_TestWithSimulator.test_happy_path/simulator.log Not sure what's wrong in the code? Continue reading...