norm icon indicating copy to clipboard operation
norm copied to clipboard

Statement logging

Open robig opened this issue 5 years ago • 1 comments

What is the recommended way to get Norm log all of the sql statements? I could not access the relevant parts in Query class to add a reliably logging. We are using log4j as backend, but also having an own Logger providing more logging options for writing nice html logs. But at least a log to log4j debug is required.

Thanks

robig avatar Apr 23 '20 07:04 robig

Two choices:

  1. Use a JDBC proxy: https://vladmihalcea.com/the-best-way-to-log-jdbc-statements/

  2. Modify norm source. It should be pretty easy. I would insert a logging statement in two places, in Query.execute() just above state.executeUpdate(), and in the Query.results() method, just above state.executeQuery().

ccleve avatar Apr 23 '20 16:04 ccleve