You might want to look at how p6spy do things.  From memory they
supply a proxy jdbc driver that delegates to the actual driver to do
the work.

-- Ewan

On Jul 23, 9:33 pm, Derek Chen-Becker <[email protected]> wrote:
> Well, I'm looking at the code in DB and what we may have to do is write
> wrappers for Statement and PreparedStatement that would allow us to do the
> logging. The functions in DB mostly take user-provided functions like
> PreparedStatement => T, so there's no way to get at the parameters that are
> being provided directly. Let me noodle on this and see what I can do. We
> already have a SuperConnection, so I don't see a problem with a
> LoggingStatement and LoggingPreparedStatement. This seems common enough that
> there may already be a library of wrappers that we could use out there.
>
> Derek
>
> On Thu, Jul 23, 2009 at 1:23 PM, marius d. <[email protected]> wrote:
>
> > Looking a the code looks to me that the query is just a toString call
> > for a Statement reference which won't yield what we'd expect. Just
> > spoke with Derek about this. He'll take a look on it and eventually
> > add this support soon enough.
>
> > Br's,
> > Marius
>
> > On Jul 23, 10:01 pm, Jon <[email protected]> wrote:
> > > On Jul 23, 8:56 pm, Jeppe Nejsum Madsen <[email protected]> wrote:
>
> > > > "marius d." <[email protected]> writes:
> > > > > I'm not sure if that logs the statements with the actual values. Does
> > > > > it ?
>
> > > > Strange, just tried it because I definitely remember seeing values
> > > > being logged, but turns out not all statements have values logged and
> > it
> > > > seem just queries are logged.
>
> > > > /Jeppe
>
> > > I tried this:
> > > DB.addLogFunc((query, len) => Log.info("The query: "+query+" took "+len
> > > +" milliseconds"))
>
> > > ... and only got things like this:
> > > INFO - The query: b8450018-0122-a854-9ce5-000000cde658 took 47
> > > milliseconds
>
> > > Not exactly what I was interested in. ;-)
>
> > > /Jon
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" 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/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to