title: Django logging to console
body: <p>I'm trying to set up a logger that will log to the console (I want this because I'm using Heroku with Papertrails (Heroku's logging addon) and stuff written to the console will show up in Papertrails, making it filterable and all the nice Papertrail features.)</p>
  
  <p>In settings I was first trying the following:</p>
  
  <pre><code>LOGGING = {
      'handlers' = {
          'file': {
              'level': 'DEBUG',
              'class': 'logging.FileHandler',
              'filename': 'mysite.log',
              'formatter': 'verbose'
          },
          'console':{
              'level': 'DEBUG',
              'class': 'logging.StreamHandler',
          },
      },
      (...)
      'loggers'={
          (...)
          'page_processors': {
              'handlers': ['console','file'],
              'level': 'DEBUG',
          }
      }
      (...)
  }
  </code></pre>
  
  <p>as per the Django's logging page (for those who don't use Mezzanine, page_processors are what Mezzanine runs whenever you open a page; you can think of them as being like Django's views, but they only do the context, not the rendering).</p>
  
  <p>On page_processors.py I have</p>
  
  <pre><code>import logging
  logger = logging.getLogger(__name__)
  
  @process_for(MyPage):
  def myfunc(request, Page):
      logger.info('page_processor logging test')
      print 'my page_processor print'
      (...)
  </code></pre>
  
  <p>When I refresh the page I don't see the logger but I see the print AND the log to the file:</p>
  
  <pre><code>[02/Mar/2014 23:07:10] INFO [myApp.page_processors:13] page_progessor logging test
  </code></pre>
  
  <p>and so I know the logic is working. After googling a bit, I found <a href="http://codeinthehole.com/writing/console-logging-to-stdout-in-django/" rel="noreferrer">this</a> and <a href="http://help.papertrailapp.com/kb/configuration/configuring-centralized-logging-from-python-apps" rel="noreferrer">this page</a> that addresses precisely this issue. He says that by default logging.StreamHandler logs to STDERR. If we want to log to STDOUT you should add the keyword argument 'stream' to the logging.StreamHandler construct, and so configure the handler as such:</p>
  
  <pre><code>'handlers':{
      (...)
      'console':{
          'level': 'DEBUG',
          'class': 'logging.StreamHandler',
          'stream': sys.stdout
      },
  }
  </code></pre>
  
  <p>Turns out this still doesn't work, and I don't get any error or anything, and I still see the print and the file log. Just not the console logger.</p>
  
  <p>What's going on?</p>
  
  <p>EDIT:
  I tried <a href="https://stackoverflow.com/a/10779574/1950164">this</a>, doesn't make a difference.</p>