Re: Logging/debugging queries
Anthony Tuininga <[email protected]> Wed, 19 Oct 2016 08:08:41 -0600
| Newsgroups | gmane.comp.python.db.cx-oracle |
|---|---|
| Message-ID | <CAE1XR-6gBFV=68nAcbn3X1C2HtGW1x_NXD1_r2BsHdhUHQt+7A@mail.gmail.com> |
Hi Piotr, There is no built-in way of logging the queries sent to the database....but cx_Oracle *does* have a way that you can do that yourself. Essentially you can subclass the connection and cursor and override the execute() method in order to perform any logging you might want to do before or after the actual execution of the statement takes place. You can see an example in action with a module called cx_OracleEx. You can see it here: https://bitbucket.org/anthony_tuininga/cx_pyoraclelib/src/dda6bfb0217bc48ea7c20cb763b3385e8fc9bfaa/cx_OracleEx.py?at=default&fileviewer=file-view-default Anthony On Wed, Oct 19, 2016 at 3:20 AM, Piotr Dobrogost < [email protected]> wrote: > Hi! > > Is there a way to configure cx_oracle so that it would log queries sent to > db? > I'm particularly interested in logging values of bound parameters. > > > Best regards, > Piotr Dobrogost > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > cx-oracle-users mailing list > cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ cx-oracle-users mailing list cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/cx-oracle-users