what does logging.basicConfig does?
<p>I was reading loggers in python and got confused with logging.basicConfig() method. As mentioned in the python docs that it set many config for root logger, does that mean that it set the configs only for root logger or does it do it even for user created loggers also ?</p>

<p>Another doubt is that whenever we create a user defined logger, does it become child logger of root logger ?</p>

<p>To answer your second part:</p>

<pre><code>    # Pass no arguments to get the root logger
    root_logger = logging.getLogger()
    # This logger is a child of the root logger
    logger_a = logging.getLogger('foo')
    # Configure logger_a here e.g. change threshold level to logging.DEBUG
    # This is a child of logger_a
    logger_b = logging.getLogger('foo.bar')
</code></pre>

<p>Both <code>logger_a</code> and <code>logger_b</code> are user-defined, but only <code>logger_a</code> will inherit the default configuration of <code>root_logger</code>. If, between lines 4 &amp; 6 of the above, you were to configure <code>logger_a</code> so that it had different settings to <code>root_logger</code>, <code>logger_b</code> would default to <code>logger_a</code>'s settings rather than <code>root_logger</code>'s, since it is a direct descendant of <code>logger_a</code> and not <code>root_logger</code>.</p>

python logging