gavlyukovskiy / spring-boot-data-source-decorator

Spring Boot integration with p6spy, datasource-proxy, flexy-pool and spring-cloud-sleuth
Apache License 2.0
870 stars 83 forks source link

Application property "decorator.datasource.p6spy.log-filter.pattern" is not working as expected #99

Open abhishekjoy1 opened 5 months ago

abhishekjoy1 commented 5 months ago

Hi, I am using the following dependencies for p6spy in my Spring boot project:

<dependency>
    <groupId>com.github.gavlyukovskiy</groupId>
    <artifactId>p6spy-spring-boot-starter</artifactId>
    <version>1.7.1</version>
</dependency>

<dependency>
    <groupId>com.github.gavlyukovskiy</groupId>
    <artifactId>datasource-decorator-spring-boot-autoconfigure</artifactId>
    <version>1.7.1</version>
</dependency>

<dependency>
    <groupId>p6spy</groupId>
    <artifactId>p6spy</artifactId>
    <version>3.9.1</version>
</dependency>

Related property values in application.properties are as follows:

decorator.datasource.p6spy.log-format=%(executionTime)|%(category)|connection%(connectionId)|%(sqlSingleLine)
decorator.datasource.p6spy.log-filter.pattern=\d+\|statement\|(.*)$
decorator.datasource.p6spy.tracing.include-parameter-values=true

Here everything is working as expected except for the log filter, all rollback and commit statements are still getting printed in the log:

0|rollback|connection1|
1|commit|connection1|

Not sure, if I am missing anything.

gavlyukovskiy commented 3 months ago

@abhishekjoy1 it's hard for me to debug this without more details. Please provide a minimal sample project where the problem can be reproduced easily. P.S. you're using quite old version, please update to 1.9.1 (Spring Boot 3) or 1.8.1 (Spring Boot 2) first