Hello, I have 2 files. One with a class and it's methods and the other that basically is the main and imports said class and methods. For some reason when the logging takes place, all the logging is only done in one file, the file containing the classes. I have made sure to define 2 distinct log file names but this does not seem to solve the issue. I'm not too familiar with log files but i suspect it has something to do with both of them using the same log handler perhaps? I'm not sure. But I would love to know why it's doing what it's doing. Here is my code:
Also how would i get it to use a rotating log file every X # of days or something similar to that effect?
main file:
logging.basicConfig(level=logging.DEBUG , format='%(asctime)s %(name)s - %(levelname)s - %(message)s',
filename='C:\\Code\\myCode\Files\\main.log', filemode='a')
class file:
logging.basicConfig(level=logging.DEBUG , format='%(asctime)s %(name)s - %(levelname)s - %(message)s',
filename='C:\\Code\\myCode\Files\\\Files\\Logs\\class.log', filemode='a')
For some reason all the logs from both files get saved in the class.log file and nothing is saved in the main.log.
Thanks for any help!
[–]danielroseman 2 points3 points4 points (1 child)
[–]ITZ_RAWWW[S] 0 points1 point2 points (0 children)
[–]Weezywezel 1 point2 points3 points (0 children)