[Lift] Re: SQL dumping in log?

2009-07-24 Thread marius d.
Looks good to me ... and they have Apache license ;) Br's, Marius On Jul 23, 11:33 pm, Derek Chen-Becker dchenbec...@gmail.com 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.

[Lift] Re: SQL dumping in log?

2009-07-24 Thread Ewan
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 dchenbec...@gmail.com wrote: Well, I'm looking at the code in DB and what we may have to do is write

[Lift] Re: SQL dumping in log?

2009-07-24 Thread Ewan
Logging works ok with MySQL but not Derby as I discovered when moving to MySQL when playing with stax. -- Ewan On Jul 23, 11:27 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: Jon jon.klei...@usit.uio.no writes: On Jul 23, 8:56 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: marius d.

[Lift] Re: SQL dumping in log?

2009-07-24 Thread Jon
With Lift 1.0 and my tiny test app. against Oracle, and this: DB.addLogFunc ((q, t) = Log.info(Query(+t+): +q)) ... I get this: INFO - Query(73): oracle.jdbc.driver.t4cpreparedstatem...@10b868 INFO - Query(241): oracle.jdbc.driver.t4cpreparedstatem...@10b868 INFO - Service request (GET)

[Lift] Re: SQL dumping in log?

2009-07-24 Thread Jeppe Nejsum Madsen
Jon jon.klei...@usit.uio.no writes: With Lift 1.0 and my tiny test app. against Oracle, and this: DB.addLogFunc ((q, t) = Log.info(Query(+t+): +q)) ... I get this: INFO - Query(73): oracle.jdbc.driver.t4cpreparedstatem...@10b868 INFO - Query(241):

[Lift] Re: SQL dumping in log?

2009-07-24 Thread Derek Chen-Becker
It's JDBC drivers. Essentially, we're calling toString on the PreparedStatement object. Different vendors do different things, since there's nothing in the spec about toString behavior. The advantage to using something like log4jdbc (or p6spy, haven't looked at that one) is that they will log the

[Lift] Re: SQL dumping in log?

2009-07-23 Thread Jeppe Nejsum Madsen
Jon jon.klei...@usit.uio.no writes: Hi, Is it possible to dump/log all SQL statements going to the database, so that one can see all the SELECTs, INSERTs etc.? Look into DB.addLogFunc /Jeppe --~--~-~--~~~---~--~~ You received this message because you are

[Lift] Re: SQL dumping in log?

2009-07-23 Thread marius d.
I'm not sure if that logs the statements with the actual values. Does it ? Br's, Marius On Jul 23, 7:48 pm, Jeppe Nejsum Madsen je...@ingolfs.dk wrote: Jon jon.klei...@usit.uio.no writes: Hi, Is it possible to dump/log all SQL statements going to the database, so that one can see all

[Lift] Re: SQL dumping in log?

2009-07-23 Thread Jeppe Nejsum Madsen
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.

[Lift] Re: SQL dumping in log?

2009-07-23 Thread Jon
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

[Lift] Re: SQL dumping in log?

2009-07-23 Thread marius d.
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

[Lift] Re: SQL dumping in log?

2009-07-23 Thread Derek Chen-Becker
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

[Lift] Re: SQL dumping in log?

2009-07-23 Thread Derek Chen-Becker
Well, that was quick. After a few minutes of searching, I found this: http://code.google.com/p/log4jdbc/ This seems like a much cleaner way to do the logging than to hook it into Lift directly. Thoughts? Derek On Thu, Jul 23, 2009 at 2:33 PM, Derek Chen-Becker dchenbec...@gmail.comwrote:

[Lift] Re: SQL dumping in log?

2009-07-23 Thread Jeppe Nejsum Madsen
Jon jon.klei...@usit.uio.no writes: 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