Python Forum

Full Version: Logging in many submodules
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Let's say I have 20 modules, and I want to log all messages in this modules.

For example

Project
-- package1
-- test1.py
-- test2.py

-- package2
-- test1.py
-- test2.py
...
...

If I do
logging.getLogger(__name__)
in every modules, is this good practise ? Or do I use different method ? Also I will log to two files in every modules. There is one main log file, every module will write messages to main log file and also every module will write own messages to a specif file. I am trying to log efficiently.

What is your recommendation ?