I need to log all the queries on my sql instances, filter those that seem to fetch too many rows and archive it for a period of time.
Doc says
(2) All SQL queries executed on the database instance
about "Data Access audit logs".
So I've set out to enable access audit logs for my cloud sql server.I have checked data read in the audit logs api page as said inhere, but I cannot seem to find it anywhere in the log explorer. I have aleady checked log names for "projects/PROJECT_NAME/logs/cloudaudit.googleapis.com%2Fdata_access" to no use.
What am I missing? what am I doing wrong?
- Is it in MySQL? And you need to log the query to the Database, not to the Cloud SQL REST API, correct?guillaume blaquiere– guillaume blaquiere2021-02-22 08:16:00 +00:00CommentedFeb 22, 2021 at 8:16
- @guillaumeblaquiere Yes,It's MySQL and yes, it's quries executed on the db. I was planning to send all query records to Cloud Logging first and then proccessing them on a regular basis. Should I turn to turning general_log on ?Daniel Kim– Daniel Kim2021-02-22 08:29:43 +00:00CommentedFeb 22, 2021 at 8:29
1 Answer1
To view the logs in Cloud Logging you need toactivate the flaggeneral_log in theMySQL flags feature page.
2 Comments
Explore related questions
See similar questions with these tags.

