I\'m looking for concrete advice about how the multiple module and multiple handler logging should be done. I have added my simplified code here, but I don\'t want to bias t
To kinda wrap this up, here is what I did; I've put the following two lines in every module/file:
import logging
logger = logging.getLogger(__name__)
This sets up the logging, but doesn't add any handlers. I then add handlers to the root logger in the main file I'm running the imported modules therefore pass their records to the root logger and everything gets saved and displayed. I do it like CaptainMurphy suggested, but with logger = logging.getLogger('')
to work with the root logger
To address encoding - I had problems saving non-ascii strings to file. So I just added FileHandler
to the root logger, where encoding can be specified. I couldn't do it with logging.basicConfig
.
Thank you again @CaptainMurphy - I'm sorry I can't upvote you with my low reputation, but I've checkmarked the answer.