# Logger.disabled is set to True once logging.config.fileConfig is called

**URL:** <https://discuss.python.org/t/logger-disabled-is-set-to-true-once-logging-config-fileconfig-is-called/16574>\
**Category:** Python Help\
**Created:** [June 17, 2022, 6:43am UTC](https://discuss.python.org/t/logger-disabled-is-set-to-true-once-logging-config-fileconfig-is-called/16574 "2022-06-17T06:43:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ardeal](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/ardeal/32/4101_2.png) [@ardeal](https://discuss.python.org/u/ardeal)\
**Post date:** [June 17, 2022, 6:43am UTC](https://discuss.python.org/t/logger-disabled-is-set-to-true-once-logging-config-fileconfig-is-called/16574/1 "2022-06-17T06:43:46Z")

</div>

Hi,

for the following code and config file,

the `logger` works correctly before funcion ‘logging.config.fileConfig’.  
After ` logging.config.fileConfig`, `logger.disabled` is set to `True` which leads to logger doesn’t print anything.

My question is:  
why is `logger.disabled` set to `True` by ` logging.config.fileConfig`?

```nohighlight
def init_logging(log_file_name):
    root_logger = logging.getLogger('aaABC')
    root_logger.setLevel(logging.INFO)
    formatter = logging.Formatter("%(message)s")
    
    file_handler = logging.FileHandler(log_file_name)
    file_handler.setLevel(logging.INFO)
    root_logger.addHandler(file_handler)
    
    console_handler = logging.StreamHandler()
    console_handler.setLevel(logging.INFO)
    root_logger.addHandler(console_handler)

    return root_logger

if __name__ == ' __main__':

    output_dir = 'output'
    logging_conf_file = 'logging_2.conf'
    filename = 'log_{}.txt'.format(datetime.now().strftime('%Y%m%d_%H%M%S'))
    log_file_path = os.path.join(output_dir, filename)

    logger = init_logging(log_file_path)
    logger.info('2')

    logging.config.fileConfig(logging_conf_file)

    logger.info('3')
    logging.info('9')

```

` **logging_2.conf** `:

```nohighlight
[loggers]
keys=root,ABC

[handlers]
keys=consoleHandler

[formatters]
keys=simpleFormatter

[logger_root]
level=DEBUG
handlers=consoleHandler

[logger_ABC]
level=DEBUG
handlers=consoleHandler
qualname=ABC
propagate=0

[handler_consoleHandler]
class=StreamHandler
level=DEBUG
formatter=simpleFormatter
args=(sys.stdout,)

[formatter_simpleFormatter]
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
datefmt=

```

---

<div class="post-metadata">

**Author:** ![vsajip](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vsajip/32/44_2.png) [@vsajip](https://discuss.python.org/u/vsajip)\
**Post date:** [June 20, 2022, 9:28am UTC](https://discuss.python.org/t/logger-disabled-is-set-to-true-once-logging-config-fileconfig-is-called/16574/2 "2022-06-20T09:28:29Z")

</div>

It’s documented [here](https://docs.python.org/3/library/logging.config.html#logging.config.fileConfig). Note the `disable_existing_loggers` keyword argument.
