How can I change the Hibernate logging level programmatically?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Hibernate uses SLF4j as it’s logging API. Looking at this API I can’t find any way to adjust the logging level programatically.
So in my opinion you have to use the underlying runtime logging system directly. This depends on what you have configured. When using log4j this would be something like
But remember that going this way your code is dependent on the underlying logging implementation.