title: Logging configuration for Flask applications run by paster.deploy
body: <p>The access log and root log for my Flask app was helped by zcbuildout. That's fine. Now I wondered how do I get logging from my own app. I know how to use logging library but paster just do not log it in the console or anywhere.</p>
  
  <p>Thanks</p>
  
  <p>Here's my config:</p>
  
  <pre><code>[loggers]
  keys = root, wsgi, myapp
  
  [handlers]
  keys = console, accesslog
  
  [formatters]
  keys = generic, accesslog
  
  [formatter_generic]
  format = %(asctime)s %(levelname)s [%(name)s] %(message)s
  
  [formatter_accesslog]
  format = %(message)s
  
  [handler_console]
  class = StreamHandler
  args = (sys.stderr,)
  level = NOTSET
  formatter = generic
  
  [handler_accesslog]
  class = FileHandler
  args = (os.path.join(r'.', 'access.log'), 'a')
  level = INFO
  formatter = accesslog
  
  [logger_root]
  level = INFO
  handlers = console
  
  [logger_wsgi]
  level = INFO
  handlers = accesslog
  qualname = wsgi
  propagate = 0
  
  [logger_myapp]
  level = DEBUG
  handlers = console
  qualname = myapp
  
  [filter:translogger]
  use = egg:Paste#translogger
  setup_console_handler = False
  logger_name = wsgi
  
  [app:main]
  use = egg:myapp#debug
  filter-with = translogger
  ...
  </code></pre>
  
  <p>Here's how I tried to log:</p>
  
  <pre><code>import logging as log
  
  def myfunc():
      log.debug("show me the log")
  </code></pre>