title: FASTAPI logging to file
body: <p>Why doesnt FastAPI create the log file when I am logging </p>
  
  <p>Here is the code that I used</p>
  
  <pre><code>from fastapi.logger import logger as fastapi_logger
  from logging.handlers import RotatingFileHandler
  import logging
  
  formatter = logging.Formatter(
          "[%(asctime)s.%(msecs)03d] %(levelname)s [%(thread)d] - %(message)s", "%Y-%m-%d %H:%M:%S")
  handler = RotatingFileHandler('logfile.log', backupCount=0)
  logging.getLogger("fastapi")
  fastapi_logger.addHandler(handler)
  handler.setFormatter(formatter)
  
  fastapi_logger.info('****************** Starting Server *****************')
  </code></pre>
  
  <p>the file <em>'logfie.log'</em> isn't generated automatically unlike in flask. is there any other configuration for this?</p>