title: How to set up logging for a Python Pyramid Waitress server?
body: <p>I am trying to setup logging for a Python Pyramid Waitress Server.  I have followed the docs here:
  <a href="https://pylons.readthedocs.org/projects/waitress/en/latest/" rel="noreferrer">Pyramid logging</a> and here: <a href="http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/paste.html" rel="noreferrer">Pyramid PasteDeploy logging</a>.   I have tired both methods which have yield no logging results from waitress.  My own logging works perfectly.</p>
  
  <p>I have set Waitress logging level to DEBUG and I get nothing even I remove server files.  Waitress fails server silently.  </p>
  
  <p>How do you set up logging for a Pyramid Waitress Server so I can see files be requested, missing file errors, etc?</p>
  
  <p>Method 1:
  Setup from code:</p>
  
  <pre><code>import logging
  logging.basicConfig()
  logger = logging.getLogger('waitress')
  logger.setLevel(logging.DEBUG)
  </code></pre>
  
  <p>Method 2:
  Starting the server with pserve development.ini where the development.ini file sets up the logging as below</p>
  
  <pre><code>[app:main]
  use = egg:MyProject
  
  pyramid.reload_templates = true
  pyramid.debug_authorization = false
  pyramid.debug_notfound = false
  pyramid.debug_routematch = false
  pyramid.default_locale_name = en
  pyramid.includes =
  pyramid_debugtoolbar
  
  [server:main]
  use = egg:waitress#main
  host = 0.0.0.0
  port = 6543
  
  
  
  [loggers]
  keys = root, myproject, waitress
  
  [handlers]
  keys = console
  
  [formatters]
  keys = generic
  
  [logger_root]
  level = INFO
  handlers = console
  
  [logger_myproject]
  level = DEBUG
  handlers =
  qualname = myproject
  
  
  [logger_waitress]
  level = DEBUG
  handlers =
  qualname = waitress
  
  
  [handler_console]
  class = StreamHandler
  args = (sys.stderr,)
  level = NOTSET
  formatter = generic
  
  [formatter_generic]
  format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
  </code></pre>