python logging module AttributeError: 'str' object has no attribute 'write'
Question: I am using tornado,and in its app,I import logging just want to log some info
about server. I put this:

    
    
    logging.config.dictConfig(web_LOGGING)
    

right before:

    
    
     tornado.options.parse_command_line()
    

but when I run the server,when I click any link,I get error:

    
    
    Traceback (most recent call last):
      File "/usr/lib/python2.7/logging/__init__.py", line 874, in emit
        stream.write(fs % msg)
    AttributeError: 'str' object has no attribute 'write'
    Logged from file web.py, line 1946
    

it just repeats when i click into any link. what is the real problem?

I've already changed any file,directory to others to steer clear of namespace
conflict...


Answer: Psychic debugging says `web_LOGGING` has a key named `stream` with a `str`
value (probably a file path); [`stream` is only for already opened files, if
you want to pass a file path, it's passed as
`filename`](https://docs.python.org/3/library/logging.html#logging.basicConfig).

