pythonloggingsqlalchemypython-logging

How to turn sqlalchemy logging off completely


sqlalchemy is keep loggin to console even I have the following code

import logging
logger = logging.getLogger()
logger.disabled = True

How to turn off sqlalchemy's logging completely?


Solution

  • Did you pass echo=True to create_engine()? By default it creates StreamHandler which outputs to console. As documentation says, if you didn't provide any echo=True arguments and didn't configure root sqlalchemy logger, it will not log anything.