apache / shardingsphere

Empowering Data Intelligence with Distributed SQL for Sharding, Scalability, and Security Across All Databases.
Apache License 2.0
19.98k stars 6.75k forks source link

[SQLLogger] : Wanted to check if there is a way to handle to remove logs "Logic SQL:" and keep "Actual SQL" #33736

Closed atul-singh-20230331 closed 1 day ago

atul-singh-20230331 commented 1 day ago

Is is possible to remove the the log "Logic SQL:" log from below class line no 46 ?

I can see there is a config "ConfigurationPropertyKey.SQL_SHOW" to show the logic sql log is there but that would remove "Actual SQL" log also .

is there anyway to show "Actual SQL" log and remove "Logic SQL:"

Class for reference:

https://github.com/apache/shardingsphere/blob/71b72a0b4563a8c3e4b42247692b237ac7b83944/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/log/SQLLogger.java#L46

terrymanu commented 1 day ago

Logic SQL is the external SQL of ShardingSphere and should always be paid attention to.

atul-singh-20230331 commented 1 day ago

Thanks Terry for the reply. Understood, is there any plan to decouple "Actual SQL" and "Logic SQL:" logging from same method . Currently "Actual SQL" can only be enabled only if "Logic SQL:" is enabled .

terrymanu commented 1 day ago

For my understanding, Logic SQL is required which can be a key, Actual SQLs are optional which should be values.

atul-singh-20230331 commented 1 day ago

Thanks @terrymanu it's clear now and appreciate your quicker response.