Jose,

Try it without the level=, format=, and datefmt= options in
logging.basicConfig() (leaving in only filename= and filemode=) and I
think it'll work.  Then you can try adding in the other options one at
a time and see if you can get them to work.  When I only had filename
and filemode specified, things worked.  Once I started adding more
parameters, I had similar problems.

Brian

On 1/6/07, jose <[EMAIL PROTECTED]> wrote:
>
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to