k3s-io / kine

Run Kubernetes on MySQL, Postgres, sqlite, dqlite, not etcd.
Apache License 2.0
1.49k stars 226 forks source link

Don't dump the full SQL payload when `SlowSQLThreshold` is exceeded #305

Closed brandond closed 6 days ago

brandond commented 3 weeks ago

The info-level message produced when a query exceeds the SlowSQLThreshold duration includes a full dump of the SQL request, including the parameters. This is unnecessarily verbose, and may leak confidential information into the logs. SQL query parameters should only be dumped when logging at Trace level; the log message should not include the payload when printing at lower levels.

mezgerj commented 6 days ago

@brandond I took a shot at this in https://github.com/k3s-io/kine/pull/307 . This is my first kine MR so please let me know if anything looks out of place