title: Log only to a file and not to screen for logging.DEBUG
body: <p>I have the following script that I want only the "DEBUG" log messages to be logged to the file, and nothing to the screen.</p>
  
  <pre><code>from flask import Flask, request, jsonify
  from gevent.pywsgi import WSGIServer
  import usaddress
  app = Flask(__name__)
  
  from logging.handlers import RotatingFileHandler
  import logging
  #logging.basicConfig(filename='error.log',level=logging.DEBUG)
  
  
  # create a file to store weblogs
  log = open('error.log', 'w'); log.seek(0); log.truncate();
  log.write("Web Application Log\n"); log.close();
  
  log_handler = RotatingFileHandler('error.log', maxBytes =1000000, backupCount=1)
  
  formatter = logging.Formatter(
      "[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s"
      )
  log_handler.setFormatter(formatter)
  app.logger.setLevel(logging.DEBUG)
  app.logger.addHandler(log_handler)
  
  @app.route('/')
  def hello():
    return "Hello World!"
  
  @app.route("/parseAddress", methods=["POST"])
  def parseAddress():
    address = request.form['address']
    return jsonify(usaddress.tag(address)), 200
  
  if __name__ == '__main__':
  #  app.run(host='0.0.0.0')
    http_server = WSGIServer(('', 5000), app, log=app.logger)
    http_server.serve_forever()
  </code></pre>
  
  <p>But right now even "INFO" messages are being logged to the file and to the screen. How can I have only the "DEBUG" messages logged to the file and nothing to the screen?</p>