Query with sensitive info in logs

Hi everyone :wave:
I noticed that Metabase prints the full query in the logs when some errors occur. The issue is that these queries might have Personal Identifiable Information and we don't want to have that in the logs.

Is there a way to filter out the SQL from the error logs without losing the rest of the log message by configuration? :thinking:
If it needs to be a custom post-processing log filter can someone provide any hints on how to redact only the query from the log?

Example: A query like "select * from users where email = 'john.doe@email.com'" if printed on the logs will contain (at least possible) PII.

1 Like

V46 should include some very important tweaks on what we show in the errors of the query, I would check the new release candidate. Btw: you can’t strip something specific from the query unless you modify the code

2 Likes

Thank you for the quick reply!
I tried looking into the V46 release notes but couldn't find anything related to the logs. Do you by any chance know which PR changes this behaviour?

1 Like

Nothing on the logs side, we’re going to show just the error in the sql in the native query editor. Logs are only accessible by admins or sysadmins

1 Like