Search code examples
pythonsqlalchemyturbogearsturbogears2

Logging queries with sqlalchemy 0.6


With turbogears 2.1 and sqlalchemy 0.7 the queries from console were logged out to stdout. However I needed to downgred to 0.6 and they no longer appear. Documentation of logging seems to be identical and I couldn't find anything in changelog. How to log in sqlalchemy 0.6?

EDIT The DBSession.bind.echo is set to False. If I set it to True it works. Any idea how to set it correctly (I'v modified model/__init__.py setting engine.echo = True).


Solution

  • Your configuration file should have the specified options. Look for those inside the development.ini

    sqlalchemy.echo = true
    sqlalchemy.echo_pool = true