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. <marius.dan...@gmail.com> 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 <jon.klei...@usit.uio.no> wrote:
> > On Jul 23, 8:56 pm, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:
> >
> > > "marius d." <marius.dan...@gmail.com> 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 liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to