I have objects called Job which has it's own logger (each Job need to have a log file which is represented by logging.getLogger())
The problem is I create thousands of Jobs (~4000) and they all want to create a logger.
Traceback (most recent call last):
File "/u/lib/btool/Job.py", line 151, in __init__
File "/usr/lib/python2.7/logging/__init__.py", line 911, in __init__
File "/usr/lib/python2.7/logging/__init__.py", line 936, in _open
IOError: [Errno 24] Too many open files: '/x/zooland/20160710-032802.log'
Is there way to deal with multiple loggers?
FileHandlerkeeps the file object open. If it does, then another idea would be write your custom file handler which opens the file, appends the message and then closes the file.