I\'ve got the following code running on each request of a wsgi (web2py) application:
import logging, logging.handlers
from logging import StreamHandler, Formatte
You can remove the default handler from the getLogger() using this:
logging.getLogger().removeHandler(logging.getLogger().handlers[0])
Or clear the existing handlers first before adding handlers that you want:
logging.getLogger().handlers.clear()
After doing so, these logs will no longer display except the new handlers you have added:
DEBUG: Do stuff
WARNING: Do stuff