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

Hibernate binding parameters not showing in logs #36640

Closed
bizwms opened this issue Jul 30, 2023 · 3 comments
Closed

Hibernate binding parameters not showing in logs #36640

bizwms opened this issue Jul 30, 2023 · 3 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@bizwms
Copy link

bizwms commented Jul 30, 2023

I'm using Spring Boot version 3.1.1 and I've noticed that the Hibernate binding parameters are not showing in the logs. I've set the logging level for org.hibernate.type.descriptor.sql.BasicBinder to trace in my application.properties file, but it doesn't seem to have any effect.

Here is a snippet of my application.properties:

spring.jpa.show-sql=true
logging.level.org.hibernate.SQL=debug
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=trace
logging.level.org.hibernate.type.EnumType=trace
spring.jpa.properties.hibernate.format_sql=true

I expect to see the binding parameters in the logs when executing SQL queries, but currently, I only see the SQL statements without the parameters.

Any help would be appreciated.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 30, 2023
@quaff
Copy link
Contributor

quaff commented Jul 31, 2023

Hibernate renamed org.hibernate.type.descriptor.sql.BasicBinder to org.hibernate.orm.jdbc.bind.

@bizwms
Copy link
Author

bizwms commented Jul 31, 2023

I was able to output the binding parameters. thank you.
application.properties:

logging.level.org.hibernate.orm.jdbc.bind=trace

@bizwms
Copy link
Author

bizwms commented Jul 31, 2023

I will close this issue.

@bizwms bizwms closed this as completed Jul 31, 2023
@philwebb philwebb added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 31, 2023
@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2023
quaff added a commit to quaff/spring-boot that referenced this issue May 31, 2024
It's reasonable to treat prepared statement parameters as part of sql.

See spring-projects#36640 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

5 participants