My Flask App has a structure like below
- util/
-- util.py
- module/
-- mod1.py
-- mod2.py
- restserver.py
restserver.py has logging.config.dictConfig
as per https://gist.github.com/jakubczaplicki/c9077a482c2b195b7f3bcbee19dde441
This app is hosted through IIS, with the wfastcgi gateway.
So it only looks for restserver.app
module and doesn't bother about the __main__
.
I can see logs from my internal modules using this dict, but the logs from my restserver.py
routes are not appearing.
I am logging using app.logger.info()
etc.
Where should the logging.config.dictConfig
be initalized?
Before app = Flask(__name__)
or after it?
Do I need a separate logger in __main__
if I already declared it via the dictConfig
. I am looking for TimedRotatingFileHandler
All my return values and data I get back from IIS + Flask
is correct,just that my logging is not properly set up and would really like to make it work.