title: How to reference a python object in a logging configuration yaml as a stream file-like object
body: <p>I'm trying to create a yaml configuration file for my logger in python.</p>
  <p>What i need my logger to do, is to send the logs to a local file-like variable (like a stringIO), and i can accomplish this by configuring a handler inside the python file like this:</p>
  <pre><code># start logger
  mylogger = logging.getLogger('some_logger')
  # set my file-like object
  store = io.StringIO()
  # Configure handler
  myhandler = logging.StreamHandler(store)
  # add handler to my logger
  mylogger.addHandler(myhandler)
  </code></pre>
  <p>I'm trying to accomplish the same thing, but defining the handler inside a yaml file.
  Ideally, it would look like this:</p>
  <pre><code>version: 1
  handlers:
    myhandler:
      class: logging.StreamHandler
      level: INFO
      stream: store
  loggers:
    some_logger:
      level: INFO
      handlers: [myhandler]
  </code></pre>
  <p>In this yaml, i want to refence the &quot;store&quot; object as the stream of the handler, but i can't seen to accomplish this.</p>
  <p>I tried the example above, but it sets the stream as a string (store), even tough i defined a variable <code>store = io.StringIO()</code> inside the python file.</p>
  <p>Any idea on how to accomplish this?</p>
  <h3>Short script to accomplish what i want without the yaml config</h3>
  <pre><code>import logging
  import io
  
  # logger
  logger = logging.getLogger('test_logger')
  logger.setLevel(logging.INFO)
  
  # stream handler
  log_storage = io.StringIO()
  storage_handler = logging.StreamHandler(log_storage)
  
  # Add handlers
  logger.addHandler(storage_handler)
  
  # Use the logger
  logger.info(&quot;This is a info&quot;)
  
  # Get  the log from the stringIO object
  log_storage.getvalue()
  </code></pre>