Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5056

Python logging for multiple modules

$
0
0

I am working on a python project with multiple modules. I have tried to implements logging with a log.conf, which already works as expected. However, I am wondering, is there any other way to add logger into modules without adding loggers keys to log.conf? because it is quite cumbersome to add keys for each modules I need to add logger to.

Currently, my log.conf looks like this.

[loggers]keys=root,main,xx_utils,xx_config,xx_extraction, ....[handlers]keys=consoleHandler,rotatingFileHandler[formatters]keys=defaultFormatters[logger_root]handlers=consoleHandler[logger_main]handlers=rotatingFileHandlerlevel=INFOqualname=__main__propagate=1[xx_utils]handlers=rotatingFileHandlerlevel=INFOqualname=xx_utilspropagate=1....

Essentially, I am wondering whether it is possible to creata a loggerUtils class that can be imported by each modules so that I don't need to add loggers keys to log.conf.


Viewing all articles
Browse latest Browse all 5056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>