Linked Questions
31 questions linked to/from Using logging in multiple modules
-1 votes
2 answers
2k views
How to show logging message in Python
I need to show logging messages while debugging what should I do to show messages with the code like this: logs.out("Here are the error messages") logs.clear()
2 votes
0 answers
3k views
Adding the opencensus AzureLogHandler to the root logger in FastAPI applications
I am having significant difficulty with emitting logs to the Azure Application Insights. When the AzureLogHandler is initialised and added to a child logger within app.py, it works fine. However, the ...
0 votes
1 answer
2k views
Python logging for multiple modules
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 ...
1 vote
1 answer
836 views
Can't get my head around logging in multiple modules
I've been going around in circles with this for the last four hours. I've read the docs and this other SO page. This GitHub code recommends importing modules after logging has been setup in the main ...
0 votes
1 answer
1k views
Python logging creates empty log file
I am trying to setup a logging configuration to use in my different modules. I have followed different tutorials and stackoverflow posts (here, here and here) to write logs in to a project.log file. ...
1 vote
1 answer
1k views
Logging in python from multiple files
I'm definitely missing something when it comes to logging using the logging module. I can get it to work just fine if I have just 1 file with everything in it, but when I try to split things up into ...
2 votes
1 answer
589 views
Logging from multiple modules to the same log file
I have a simple project structure - my main module calls two other modules residing within the same directory. I followed the instructions per this answer to set up my test. My code is as follows: ...
0 votes
1 answer
877 views
python logging from multiple packages?
I am importing 2 modules I built into a Python script. I want to have logging from the script plus the both modules go into a single log file. The logging cookbook and related forum posts (example), ...
0 votes
1 answer
750 views
Python - Logging in multiple modules and child loggers (Azure Monitor)
I have read many docs online (Logging Cookbook, Python reference, many SO posts) but I struggle to make this working. Context: FastAPI application Docker container for deployment Azure Monitor/...
2 votes
0 answers
397 views
Python define logger in one location without using basic config or file config
The question of how to define a logger in one location was asked here: Using Python logging in multiple modules However the two top answers use basic config or a file config. I don't want to use a ...
2 votes
0 answers
306 views
Reuse Spark Session Across Modules/Packages
We are building a reusable data framework using PySpark. As part of this, we had built one big utilities package that hosted all the methods. But now, we are planning to split it apart into smaller ...
0 votes
2 answers
140 views
Why get a new logger object in each new module?
The python logging module has a common pattern (ex1, ex2) where in each module you get a new logger object for each python module. I'm not a fan of blindly following patterns and so I would like to ...
0 votes
0 answers
199 views
How to save the logs from a external package in python?
Suppose I'm working on a python project which needs to use a third-party module such as tweepy https://github.com/tweepy/tweepy. I would like to save the logs output from this third-party module to a ...
1 vote
2 answers
111 views
How to use the same logger in different python modules?
Here is what I have in the main code: from mf import gameplay .... if __name__ == "__main__": import logging logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) ...
2 votes
1 answer
103 views
How to prevent reconfiguration of root logger by modules in a multi-module project?
I am using python 2.7 for a multi-module project. As mentioned here I have configured logging in my main.py like below logging.basicConfig( format='%(asctime)s,%(msecs)d %(levelname)-8s [%(...