On Aug 2, 2011, at 7:13 PM, Chris Withers wrote:
> Hi All,
>
> Just me or does this:
>
> http://www.sqlalchemy.org/docs/core/engines.html?highlight=logging#configuring-logging
>
> ...imply that to get pool logging you just need to do:
>
> import logging
> logging.getLogger('sqlalchemy.pool').setLevel(logging.DEBUG)
>
> Whereas, in fact, you need to do:
>
> import logging
> logging.getLogger('sqlalchemy').setLevel(logging.INFO)
> logging.getLogger('sqlalchemy.pool').setLevel(logging.DEBUG)
> logging.getLogger('sqlalchemy.engine').setLevel(logging.WARNING)
> logging.getLogger('sqlalchemy.mapper').setLevel(logging.WARNING)
>
> ...to get just the pool logging, and then, with 0.6 at least, you find that
> things like checking connections in and out of the pool don't appear to be
> logged.
>
> Am I missing something here?
Not sure if you're missing anything but I certainly am. "sqlalchemy.pool" is
the only logger involved with pool logging and I'm having a hard time imagining
how you've arrived at your result !
Here is a demo:
from sqlalchemy import create_engine
import logging
logging.basicConfig()
logging.getLogger("sqlalchemy.pool").setLevel(logging.DEBUG)
e = create_engine('sqlite://')
c = e.connect()
c.close()
here is the output with 0.6:
classics-MacBook-Pro:sa06 classic$ python test.py
DEBUG:sqlalchemy.pool.SingletonThreadPool.0x...2570:Created new connection
<sqlite3.Connection object at 0x2dfc58>
DEBUG:sqlalchemy.pool.SingletonThreadPool.0x...2570:Connection
<sqlite3.Connection object at 0x2dfc58> checked out from pool
DEBUG:sqlalchemy.pool.SingletonThreadPool.0x...2570:Connection
<sqlite3.Connection object at 0x2dfc58> being returned to pool
>
> cheers,
>
> Chris
>
> --
> Simplistix - Content Management, Batch Processing & Python Consulting
> - http://www.simplistix.co.uk
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To post to this group, send email to [email protected].
> 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.
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
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.