Hi,
I am using ZeosLib 6.63 under D6 SP1 under WinXP.
The SqlMonitor works fine for me. The only issue is that it don't log the query parameters values. Is this by designed?
Because in .Net side, I am using nhibernate and log4net, it's very handy to trace sql log with query and parameters.
Cheers,
Tao
SqlMonitor don't log parameters values
Moderators: gto, EgonHugeist
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Not really 'like designed'. The query sent to the server is logged 'as is' by design. I suppose 'nobody' else before thought about also logging the bind phase for a prepared statement. This is a known issue for databases really supporting prepared statements. For databases where zeoslib emulates prepared statements this is not an issue as the query is expanded automatically.
Now we're thinking about introducing real prepared statement support we will have to add a log line for the bind values anyway. You may be the one to do it.
First step: add lcBindPrepStmt to in ZDbcLogging.pas.
Then search for the implementation of the functions ExecuteQueryPrepared, ExecuteUpdatePrepared, ExecutePrepared of the IZPreparedStatement implementations for all databases. For implementations not substituting the parameters in the sql statement there should be 3 log lines. lcPrepStmt instead of the current lcExecute (containing the sql statement), lcBindPrepStmt after the binds have been done (containing something like 'param_a:5, param_b:'a string', param_c:(BLOB)' and finally lcExecPrepStmt after a succesfull execute.
Mark
Now we're thinking about introducing real prepared statement support we will have to add a log line for the bind values anyway. You may be the one to do it.
First step: add lcBindPrepStmt to
Code: Select all
TZLoggingCategory = (lcConnect, lcDisconnect, lcTransaction, lcExecute, lcOther, lcPrepStmt, lcExecPrepStmt);
Then search for the implementation of the functions ExecuteQueryPrepared, ExecuteUpdatePrepared, ExecutePrepared of the IZPreparedStatement implementations for all databases. For implementations not substituting the parameters in the sql statement there should be 3 log lines. lcPrepStmt instead of the current lcExecute (containing the sql statement), lcBindPrepStmt after the binds have been done (containing something like 'param_a:5, param_b:'a string', param_c:(BLOB)' and finally lcExecPrepStmt after a succesfull execute.
Mark
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Hi lams,
Have a look at the 'How to use our svn repository' tutorial.
The url is : svn://firmos.at/zeos/ . Make sure you use testing branch when you want to send code patches ( svn://firmos.at/zeos/branches/testing/ ). This branch is where all new development is added before moving to trunk. Unless for documentation or cosmetic changes, it should take at least a week before changes are propagated to trunk (and eventually 6.6-patches branch).
Mark
Have a look at the 'How to use our svn repository' tutorial.
The url is : svn://firmos.at/zeos/ . Make sure you use testing branch when you want to send code patches ( svn://firmos.at/zeos/branches/testing/ ). This branch is where all new development is added before moving to trunk. Unless for documentation or cosmetic changes, it should take at least a week before changes are propagated to trunk (and eventually 6.6-patches branch).
Mark