Using Console
Using CLI
databaseFlags
field in the output of the previous command. This field contains a list of flags that are currently set for the instance.log_statement
flag is set to all
. If it is not set to all
, then it is misconfigured.log_statement
flag to all
, run the following command:
gcloud sql instances describe
command again and checking the databaseFlags
field. The log_statement
flag should now be set to all
.Using Python
google-cloud-logging
library using pip:GOOGLE_APPLICATION_CREDENTIALS
environment variable to the path of the JSON key file:
all
:log_statement = all
filter. This will ensure that all SQL statements executed on the instance are logged to the Cloud Logging service in GCP.