the "sqlalchemy.engine" logger is only statements and their parameters. the example I gave routes just that one logger to a specific file.
On Apr 18, 2013, at 9:30 AM, Richard Gerd Kuesters <[email protected]> wrote: > Thanks again Mike. I was hoping in a way to log only statements, as my app > already uses Twisted logging facilites. > > I am trying to get rid of indexing bottlenecks . > > > Cheers, > Richard. > > > On 04/17/2013 05:04 PM, Michael Bayer wrote: >> the easiest way is to use Python logging directly, where you can specify >> configurations specific to individual loggers: >> >> >> import logging >> >> logger = logging.getLogger("sqlalchemy.engine") >> handler = logging.handlers.FileHandler("somefile.log") >> handler.setFormatter(logging.Formatter('%(asctime)s - %(name)s - >> %(levelname)s - %(message)s')) >> logger.addHandler(handler) >> >> >> >> On Apr 17, 2013, at 9:45 AM, Richard Gerd Kuesters >> <[email protected]> wrote: >> >>> Hi all, >>> >>> I wonder if I can log all [and only] SQL statements made to the database >>> (using echo=True), instead of sending the output of my script | program to >>> a file. >>> >>> >>> Cheers, >>> Richard. >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "sqlalchemy" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sqlalchemy" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
