Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statement logging #48

Open
robig opened this issue Apr 23, 2020 · 1 comment
Open

Statement logging #48

robig opened this issue Apr 23, 2020 · 1 comment

Comments

@robig
Copy link

robig commented Apr 23, 2020

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

@ccleve
Copy link
Member

ccleve commented Apr 23, 2020

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().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants