Log Slow Queries Via DataSource-Proxy
Description: This application is a sample of logging only slow queries via DataSource-Proxy. A slow query is a query that has an execution time bigger than a specificed threshold in milliseconds.
Key points:
- for Maven, add in
pom.xmlthe DataSource-Proxy dependency - create an bean post processor to intercept the
DataSourcebean - wrap the
DataSourcebean viaProxyFactoryand an implementation ofMethodInterceptor - choose a threshold in milliseconds
- define a listener and override
afterQuery()


