title: Python 3.9 logger RotatingLogger doesn't write anything into file
body: <h4>I created a simple demo to test my Django project.</h4>
  <p>when i invoke unittest, everything passed and i set logger.info to record log into <code>debug.log</code>.
  There should be some records appeared in my target file but nothing in it.
  <a href="https://i.stack.imgur.com/WMW8e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WMW8e.png" alt="debug.log" /></a></p>
  <p>here is my Logger.py</p>
  <pre><code>
  import logging.config
  import os
  
  fmt = &quot;%(asctime)s|%(levelname)s|%(filename)s:%(lineno)d|%(message)s&quot;
  datefmt = &quot;%Y-%m-%d %H:%M:%S&quot;
  
  # dir
  base_path = os.path.dirname(os.path.dirname(__file__))
  log_path = os.path.join(base_path, 'logs')
  
  if not os.path.exists(log_path):
      os.mkdir(log_path)
  
  log_file = os.path.join(log_path, &quot;debug.log&quot;)
  
  file_handler = logging.handlers.RotatingFileHandler(
      # 'debug.log',
      log_file,
      backupCount=10,
      encoding='utf-8'
  )
  
  logging.basicConfig(
      format=fmt,
      datefmt=datefmt,
      handlers=[file_handler],
      level=logging.INFO
  )
  
  # logging.DEBUG
  # logging.INFO
  # logging.WARNING
  # logging.ERROR
  # logging.CRITICAL
  
  logger = logging.getLogger()
  
  
  </code></pre>
  <p>also here is the main endpoint</p>
  <pre><code>
  import json
  import unittest
  from ddt import ddt, file_data
  import api.KeywordApi as kwa
  from commons.\
      Logger import logger
  
  
  @ddt
  class loginInterfaceTestCase(unittest.TestCase):
  
      @file_data('../testDatas/testdata_interface_login.yaml')
      def test_login(self, **params):
          print(&quot;{:*^50s}&quot;.format(&quot;the first correct answer&quot;))
          path = &quot;/dologin/&quot;
          data = {
              &quot;username&quot;: params['username'],
              &quot;pwd&quot;: params['password'],
              &quot;randomCode&quot;: &quot;1234&quot;
          }
  
          # 2：send request
          res = kwa.do_post(path, data)
  
          # 3：assert
          self.assertEqual(200, res.status_code, &quot;fail:{}&quot;.format(res.status_code))
          print('text', res.text)
          # print(type(res.text))
          logger.info(type(res.text))
          # logger.info(res.text)
          print(json.dumps(res.json(), indent=2, ensure_ascii=False))
          self.assertEqual(params['code'], res.json()['code'], 'failed')
  
  
  if __name__ == '__main__':
      unittest.main()
  
  
  </code></pre>
  <p>Any ideas? A</p>