To capture SQL queries in your log file, you need to configure the logging levels for Hibernate specifically. Add these lines to your application.properties or application.yml file:
Also, ensure your log file configuration is correct:
logging.file.name=/var/log/myapp.log
This setup will log SQL queries and their parameters to your specified file. Remember to restart your application after making these changes. If you’re using a custom logging framework, you might need to adjust these settings accordingly.
hey there! have u considered using a logging framework like logback? it’s super flexible and works great with spring boot. u could configure it to log SQL queries to a specific file. what logging setup are u currently using? maybe we could brainstorm some ideas to get those queries captured!