ImportError when configuring python's logging module with a dict and custom handler
<p>I've written a custom logging handler for python's logging package.  This handler may or may not work, but this is beyond the scope of the question.</p>

<p>I'm trying to specify the handler using a configuration dict.  However the logging package seems to be unable to find the correct class.  This is the relevant section of my config dict:</p>

<pre><code>"file": {
    "class": "iis.logging.LockingFileHandler",
    .
    .
    .
}
</code></pre>

<p>Which is defined in a file <code>configuration/development.py</code>.  It is imported and passed to <code>logging.config.dictConfig</code> in a file <code>iis/__init__.py</code>.  <code>LockingFileHandler</code> is defined in a file <code>iis/logging.py</code>.  Both <code>configuration</code> and <code>iis</code> are in my path.</p>

<p>When I run flask (which imports <code>iis/__init__</code>, I get the following error message:</p>

<pre><code>Traceback (most recent call last):
  File "/usr/lib64/python3.5/logging/config.py", line 384, in resolve
    self.importer(used)
ImportError: No module named 'iis.logging.LockingFileHandler'; 'iis.logging' is not a package
</code></pre>

<p>Followed by a bunch of exceptions caused by this one.  I suspect that I am mising some trick here.  Any ideas?</p>

<p>I think I well victim to Python's confusing(!) import sematics.  The module <code>iis.logging</code> was shaddowing the global <code>logging</code> module (somehow).  Renaming to <code>iss.log</code> did the trick.</p>

python logging flask python-3.5