title: How to do logging in python in an explicit file
body: <p>I tried below code only to find that my logs are getting printed in console.
  What mistake I am doing here?</p>
  
  <pre><code>import logging
  
  logging.basicConfig(filename="logger.log",
                      format='%(asctime)s %(message)s',
                      filemode='w')
  logger=logging.getLogger()
  
  logger.setLevel(logging.INFO)
  
  logger.info("An information")
  </code></pre>
  
  <p>I am running this code as a fastapi project via uvicorn server.</p>