Closed
Description
Migrated issue, originally created by Anonymous
I like SQLAlchemy's logging integration, but when the logged data would be huge (say I'm issuing a 15000-line INSERT statement), SQLAlchemy should recognize that and truncate logged information to a reasonable maximum (say 1000 characters). Otherwise I'm forced to disable logging.
Attachments: 2243.patch
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
sqlalchemy-bot commentedon Aug 3, 2011
Anonymous wrote:
Ah, I forgot to add my e-mail address as cc: solipsis@pitrou.net. Sorry.
sqlalchemy-bot commentedon Aug 3, 2011
Anonymous wrote:
Sorry again :) It's solipsis at pitrou dot net.
sqlalchemy-bot commentedon Aug 3, 2011
Michael Bayer (@zzzeek) wrote:
Arbitrarily/implicitly truncating a generated SQL statement in the log sounds awfully unreasonable to me. I'm looking at a SQL statement right in my terminal right now that's 3195 characters, and I need every single one of them to paste into my command line tool for testing.
This use case can be handled easily within the Python logging module itself using a custom handler so for the moment I'm -1 on this as a SQLAlchemy behavior and -10 as an automatic behavior. Will forward to the development list for alternative suggestions.
sqlalchemy-bot commentedon Aug 3, 2011
Changes by Michael Bayer (@zzzeek):
sqlalchemy-bot commentedon Aug 3, 2011
Michael Bayer (@zzzeek) wrote:
Oh, you're talking about the parameter lists? That's a different story. We do truncate those in exception messages already. Can you please add some specifics here as I am open to the latter and not the former.
sqlalchemy-bot commentedon Aug 3, 2011
Anonymous wrote:
Yes, I mean the parameter lists :)
For example executing
conn.execute(sometable.insert(), some_huge_list_of_dicts)
.sqlalchemy-bot commentedon Aug 3, 2011
Michael Bayer (@zzzeek) wrote:
patch is attached some tests would be nice, for both exception throw (surprised we don't have that) as well as log output
sqlalchemy-bot commentedon Aug 3, 2011
Changes by Michael Bayer (@zzzeek):
sqlalchemy-bot commentedon Aug 22, 2011
Michael Bayer (@zzzeek) wrote:
d3c1f24
sqlalchemy-bot commentedon Aug 22, 2011
Changes by Michael Bayer (@zzzeek):