Reputation: 804
I have a python project where I want to log multiple events across different modules in a single rotating file. I am using logzero for this.
For example: If I need logging from init.py and main.py, how can I using only a single log file to log both the events?
Upvotes: 1
Views: 409
Reputation: 2851
You can specify the same log file from different python files:
logzero.logfile("logfile.log", maxBytes=1000000, backupCount=3)
It is mentioned in the documentation (Features section):
Multiple loggers can write to the same logfile (also across multiple Python files).
Upvotes: 2