title: python logging.config not available?
body: <p>In the tutorial <a href="https://fangpenlin.com/posts/2012/08/26/good-logging-practice-in-python/" rel="noreferrer">Good logging practice in Python</a> the main module looks for <code>logging.config</code> but my python 2.7 installations don't show that when I use <code>dir(logging)</code> and when I try to run this example I get:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/your-name-here/logging python/example.py", line 7, in &lt;module&gt;
  logging.config.fileConfig('logging.ini')
  AttributeError: 'module' object has no attribute 'config'
  </code></pre>
  
  <p><code>logging.config</code> certainly shows up in some <a href="https://docs.python.org/2/library/logging.config.html" rel="noreferrer">documentation</a> so it's not a mistake. Why doesn't it show up in any of my python 2.7 installations (when I type <code>dir(logging)</code> including my anaconda from last year, <em>and how can I get this example to work?</em></p>
  
  <p>main.py:</p>
  
  <pre><code>import logging
  
  # load my module
  import my_module
  
  # load the logging configuration
  logging.config.fileConfig('logging.ini')
  
  my_module.foo()
  bar = my_module.Bar()
  bar.bar()
  </code></pre>
  
  <p>my_module.py:</p>
  
  <pre><code>import logging
  
  def foo():
      logger = logging.getLogger(__name__)
      logger.info('Hi, foo')
  
  class Bar(object):
      def __init__(self, logger=None):
          self.logger = logger or logging.getLogger(__name__)
  
      def bar(self):
          self.logger.info('Hi, bar')
  </code></pre>
  
  <p>logging.ini:</p>
  
  <pre><code>[loggers]
  keys=root
  
  [handlers]
  keys=consoleHandler
  
  [formatters]
  keys=simpleFormatter
  
  [logger_root]
  level=DEBUG
  handlers=consoleHandler
  
  [handler_consoleHandler]
  class=StreamHandler
  level=DEBUG
  formatter=simpleFormatter
  args=(sys.stdout,)
  
  [formatter_simpleFormatter]
  format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
  datefmt=
  </code></pre>