Skip to content

datasource-proxy slow-query logging doesn't work as expected #128

@rolandkozma-sg

Description

@rolandkozma-sg

Hi,
I'm using datasource-proxy-spring-boot-starter 1.8.1 with spring boot 2.5.15.
Beside adding the above dependency, I also configured:
decorator.datasource.datasource-proxy.query.log-level=INFO
Then I started to see the queries logged at the info level, as expected.

However, I wasn't able to configure slow-queries to be logged using the properties:
decorator.datasource.datasource-proxy.slow-query.enable-logging=true
decorator.datasource.datasource-proxy.slow-query.log-level=WARN
decorator.datasource.datasource-proxy.slow-query.threshold=50

I'd like to log at WARN level all the queries that took longer than 50 milliseconds (although the doc says that the threshold property value is in seconds, I think that's a mistake).
After adding the above slow-query configs I still see all the logs at INFO level including the queries with longer execution time than 50 ms.
The only way I'm able to see logs at WARN level is to set the threshold to 0. Then all the logs will be with WARN.
My goal is to log only slow-queries at WARN level. Please help.

Regards,
Roland

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions