title: Python, logging: use custom handler with dictionary configuration?
body: <p>this is about the logging module on Python 3.2 (GNU/Linux x86_64): is it possible to set a custom handler with dictionary configuration?
  This is the code I'm trying:</p>
  
  <pre><code>import logging
  import logging.config
  
  class CustomHandler(logging.StreamHandler):
      pass
  
  logconfig = {
      'version': 1,
      'handlers': {
          'console': {
              'class': 'CustomHandler',
          }
      },
      'loggers': {
          'custom': {
              'handlers': ['console'],
          }
      }
  }
  logging.config.dictConfig(logconfig)
  logger = logging.getLogger('custom')
  logger.error('Error message')
  </code></pre>
  
  <p>Which of course does not work. This is the output:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/usr/lib/python3.2/logging/config.py", line 390, in resolve
      found = self.importer(used)
  ImportError: No module named CustomHandler
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "/usr/lib/python3.2/logging/config.py", line 569, in configure
      handler = self.configure_handler(handlers[name])
    File "/usr/lib/python3.2/logging/config.py", line 698, in configure_handler
      klass = self.resolve(config.pop('class'))
    File "/usr/lib/python3.2/logging/config.py", line 403, in resolve
      raise v
    File "/usr/lib/python3.2/logging/config.py", line 390, in resolve
      found = self.importer(used)
  ValueError: Cannot resolve 'CustomHandler': No module named CustomHandler
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "./prova.py", line 91, in &lt;module&gt;
      logging.config.dictConfig(logconfig)
    File "/usr/lib/python3.2/logging/config.py", line 777, in dictConfig
      dictConfigClass(config).configure()
    File "/usr/lib/python3.2/logging/config.py", line 574, in configure
      '%r: %s' % (name, e))
  ValueError: Unable to configure handler 'console': Cannot resolve 'CustomHandler': No module named CustomHandler
  </code></pre>
  
  <p>There is that <code>importer</code> method in the source which I really don't understand... Any idea?</p>
  
  <p>Thank you!</p>