title: Python logging: Flask + uWsgi + nginx
body: <p>All,
   I am not able to log INFO and DEBUG messages when running my Flask application behind uwsgi. not only the Debug and Info message are not being logged, but also the formatting is not working.</p>
  
  <pre><code>formatter = logging.Formatter(  # pylint: disable=invalid-name
      '%(asctime)s %(levelname)s %(process)d ---- %(threadName)s  '
      '%(module)s : %(funcName)s {%(pathname)s:%(lineno)d} %
      (message)s','%Y-%m-%dT%H:%M:%SZ')
  
  handler = StreamHandler()
  handler.setLevel(logging.DEBUG)
  handler.setFormatter(formatter)
  
  application.logger.addHandler(handler)
  
  logging.debug('Debug Message')
  logging.info('Info Message')
  logging.warning('Warning Message')
  logging.error('Error Message')
  logging.critical('Critical ')
  </code></pre>
  
  <p>The output in the uwsgi log file is:</p>
  
  <pre><code>*** Operational MODE: preforking ***
  WARNING:root:Warning Message
  ERROR:root:Error Message
  CRITICAL:root:Critical 
  WSGI app 0 (mountpoint='') ready in 2 seconds on interpreter 0x26f39b0 pid: 9574 (default app)
  *** uWSGI is running in multiple interpreter mode ***
  spawned uWSGI master process (pid: 9574)
  </code></pre>
  
  <p>As you can see from above, only Error, Warning and Critical messages are being logged. And the formatting is not working. (All works fine when running locally on werkzeug).</p>
  
  <p>the uwsgi config file is as follow:</p>
  
  <pre><code>[uwsgi]
  project = myproject
  uid = nginx
  group = nginx
  base = /srv
  req-logger = file:/var/log/uwsgi/access.log
  logger = file:/var/log/uwsgi/error.log
  
  chdir = %(base)/www
  home = %(base)/env
  module = application
  callable = application
  
  master = true
  processes = 4
  
  socket = /var/run/uwsgi/%(project).sock
  chown-socket = %(uid):%(group)
  chmod-socket = 664
  vacuum = true
  </code></pre>
  
  <p>I checked all the solutions on StackOverflow, but none of them worked.</p>
  
  <p>Any help is much appreciated.</p>