Hello Barry,
I'm trying to get logging work...I put in my model.py the following code
and I expected to see my queries into /tmp/sa.log file, but...
what's wrong with it?
from turbogears import database
from sqlalchemy import Table, relation
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.assignmapper import assign_mapper
import logging
database.bind_meta_data()
session = database.session
engine = database.metadata.engine
context = session.context
engine.echo = False
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(levelname)-8s %(message)s',
datefmt='%a, %d %b %Y %H:%M:%S',
filename='/tmp/sa.log',
filemode='w')
logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)ยท
Barry Warsaw wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Jan 5, 2007, at 12:01 PM, Michael Bayer 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)
Sweet.
- -Barry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iQCVAwUBRZ6IsnEjvBPtnXfVAQLINgP+JUdkjNn+CtAA5Uao3Gs+n+4IuuMeiCoz
8J9yY9XlU74AW4N1ysf0wao0r2p871t2+sgIuFnBpRxO3DficR+iji3LJ24ZeWdH
KcG/uxUGk4uF7jfMeAdzVVRe/XqVRwI1uwMCN5p2rkXjdEokJp7G8uT872nC7EM5
3OzCHKORs2M=
=PBfM
-----END PGP SIGNATURE-----
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---