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

SQL in single line instead of multiple lines #93

Closed vaithu closed 1 year ago

vaithu commented 1 year ago

My application.properties file is

logging.level.net.ttddyy.dsproxy.listener=debug
# Register P6LogFactory to log JDBC events
decorator.datasource.p6spy.enable-logging=true
# Use com.p6spy.engine.spy.appender.MultiLineFormat instead of com.p6spy.engine.spy.appender.SingleLineFormat
decorator.datasource.p6spy.multiline=true
# Use logging for default listeners [slf4j, sysout, file, custom]
decorator.datasource.p6spy.logging=sysout

And the dependency I'm using is

<!-- https://mvnrepository.com/artifact/com.github.gavlyukovskiy/p6spy-spring-boot-starter -->
        <dependency>
            <groupId>com.github.gavlyukovskiy</groupId>
            <artifactId>p6spy-spring-boot-starter</artifactId>
            <version>1.9.0</version>
        </dependency>

The SQL I'm getting is

select p1_0.id,p1_0.added_date,p1_0.batch_no,p1_0.brand,p1_0.category_entity_id,p1_0.description,p1_0.expiry_date,p1_0.image,p1_0.last_updated_date,p1_0.location,p1_0.mfg_date,p1_0.product_availability,p1_0.product_condition,p1_0.product_name,p1_0.purchase_price,p1_0.quantity,p1_0.sale_price,p1_0.serial_number,p1_0.size,p1_0.sku,p1_0.unit_entity_id,p1_0.version from product_entity p1_0 offset ? rows fetch first ? rows only
select p1_0.id,p1_0.added_date,p1_0.batch_no,p1_0.brand,p1_0.category_entity_id,p1_0.description,p1_0.expiry_date,p1_0.image,p1_0.last_updated_date,p1_0.location,p1_0.mfg_date,p1_0.product_availability,p1_0.product_condition,p1_0.product_name,p1_0.purchase_price,p1_0.quantity,p1_0.sale_price,p1_0.serial_number,p1_0.size,p1_0.sku,p1_0.unit_entity_id,p1_0.version from product_entity p1_0 offset 0 rows fetch first 100 rows only;

I'm seeing the SQL statement twice and also in single line though I've multiline=true. Anything I'm missing here ?

gavlyukovskiy commented 1 year ago

@vaithu see my answer in https://github.com/gavlyukovskiy/spring-boot-data-source-decorator/issues/14#issuecomment-383743392