OK, I've got the logging working. The INFO level gives much more than just the actual queries run against the db, but the bigger problem is that the queries aren't given in valid SQL.
Example from the log: UPDATE students SET custom_200000004=%(custom_200000004)s WHERE students.student_id = %(students_student_id)s {'custom_200000004': "'17-JAN-85'", 'students_student_id': Decimal("514")} Is there any quick way to get it to output valid SQL? I'm using postgres, so I'm now looking at the possiblity it logging the queries it receives instead. Brian
On 1/5/07, Michael Bayer <[EMAIL PROTECTED]> wrote: > > i havent gotten around to adding docs for logging to the main > docs...but its using Python's logging module now. turn off all the > "echo=True" flags and go straight to logging: > > import logging > logging.basicConfig() # see python's logging docs for options > logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO) > > the INFO level on 'sqlalchemy.engine' will give you all the queries, > the DEBUG level the queries as well as the result sets. using > "logging" you can format the log messages any way you want and pass > your own buffers in...just read the docs at > http://www.python.org/doc/2.4.2/lib/module-logging.html . > > > > > >
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---