Skip to content

Files

Latest commit

 

History

History

HibernateSpringBootP6spy

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

How To Set Up P6Spy in Spring Boot

Description: This is a Spring Boot application that uses P6Spy. P6Spy is a framework that enables database data to be seamlessly intercepted and logged with no code changes to the application.

Key points:

  • in pom.xml, add the P6Spy Maven dependency
  • in application.properties, set up JDBC URL as, jdbc:p6spy:mysql://localhost:3306/db_users
  • in application.properties, set up driver class name as, com.p6spy.engine.spy.P6SpyDriver
  • in the application root folder add the file spy.properties (this file contains P6Spy configurations); in this application, the logs will be outputed to console, but you can easy switch to a file; more details about P6Spy configurations can be found in documentation

Output sample:


If you need a deep dive into the performance recipes exposed in this repository then I am sure that you will love my book "Spring Boot Persistence Best Practices"If you need a hand of tips and illustrations of 100+ Java persistence performance issues then "Java Persistence Performance Illustrated Guide" is for you.