def METHOD_NAME(self):
    """logging test to file"""
    self._set_logging(False)
    with TemporaryDirectory() as tmp_dir:
        tmp_file = Path(tmp_dir) / "log_file"
        file_handler = nature_logging.log_to_file(
            self._logging_dict.keys(), path=tmp_file, mode="w"
        )
        try:
            # ignore Qiskit TextProgressBar that prints to stderr
            with contextlib.redirect_stderr(io.StringIO()):
                TestLogging._run_test()
        finally:
            with open(tmp_file, encoding="utf8") as file:
                lines = file.read()
            for name in self._logging_dict:
                nature_logging.remove_handler(name, file_handler)
    for name in self._logging_dict:
        self.assertTrue(f"{name}." in lines, msg=f"name {name} not found in log file.")