# 6.2.1 Ensure the ‘Log_error_verbosity’ Database Flag for Cloud SQL PostgreSQL Instance Is Set to ‘DEFAULT’ or Stricter (Automated)

- Source: https://support.icompaas.com/support/solutions/articles/62000233032-6-2-1-ensure-the-log-error-verbosity-database-flag-for-cloud-sql-postgresql-instance-is-set-to-def
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [GCP Benchmarks](https://support.icompaas.com/support/solutions/62000112667) › [GCP Knowledge Bases](https://support.icompaas.com/support/solutions/folders/62000169178)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

Profile Applicability:

-   Level 2

Description:

The log\_error\_verbosity database flag determines the level of detail included in error log messages. Accepted values are:

-   TERSE: Excludes detailed information like DETAIL, HINT, QUERY, and CONTEXT.
    
-   DEFAULT: Includes essential error details for troubleshooting.
    
-   VERBOSE: Adds extensive information, including SQLSTATE error codes, file names, function names, and line numbers.
    

For effective logging and security, this flag should be set to DEFAULT or stricter (TERSE) for all PostgreSQL database instances.

Rationale:

Proper auditing is critical for troubleshooting and forensic analysis. Setting the log\_error\_verbosity flag to DEFAULT or stricter ensures sufficient logging without excessive or irrelevant details that may clutter logs or expose sensitive information. This setting balances security, clarity, and log management.

Impact:

-   Enabling detailed logging can increase storage requirements.
    
-   Configuring custom flags may reset omitted flags to their default values, potentially causing disruptions.
    
-   It is recommended to apply flag changes during periods of low usage to minimize impact.
    

Default Value:  
The default value of the log\_error\_verbosity flag is DEFAULT.

Audit Steps:

#### Using Google Cloud Console:

1.  Navigate to the [Cloud SQL Instances](https://console.cloud.google.com/sql/instances) page.
    

                       ![](https://support.icompaas.com/assets/kb/2e677168fc36e0a5.png)

2.  Select the PostgreSQL instance to open its Instance Overview page.
    

                 ![](https://support.icompaas.com/assets/kb/8d55156047817619.png)

3.  Under the Configuration section, locate the Database Flags list.
    

                                ![](https://support.icompaas.com/assets/kb/e7e01bbc8e9ab774.png)

                         ![](https://support.icompaas.com/assets/kb/f94f9a981a33bab2.png)

4.  Verify that the log\_error\_verbosity flag is set to DEFAULT or stricter (TERSE).
    

                 ![](https://support.icompaas.com/assets/kb/eda8418885d5b5d1.png)

#### Using Google Cloud CLI:

List all Cloud SQL PostgreSQL database instances:

gcloud sql instances list

For each instance, verify the value of the log\_error\_verbosity flag:

gcloud sql instances describe <INSTANCE\_NAME> --format=json | jq '.settings.databaseFlags\[\] | select(.name=="log\_error\_verbosity") | .value'

1.  The expected output should show DEFAULT or TERSE.
    

Remediation Steps:

#### Using Google Cloud Console:

1.  Navigate to the [Cloud SQL Instances](https://console.cloud.google.com/sql/instances) page.
    

                        ![](https://support.icompaas.com/assets/kb/289fe67837efe59d.png)

2.  Select the PostgreSQL instance where the flag needs to be updated
    

               ![](https://support.icompaas.com/assets/kb/92cf563fd318bf76.png)     .

3.  Click Edit.
    

             ![](https://support.icompaas.com/assets/kb/01f2d97610baf277.png)

4.  Scroll to the Flags section and click Add a Database Flag.
    

                  ![](https://support.icompaas.com/assets/kb/d5392eae3f056ca9.png)

5.  Select log\_error\_verbosity from the dropdown and set its value to DEFAULT or TERSE.
    

                   ![](https://support.icompaas.com/assets/kb/3ab9a0055e8610ea.png)

6.  Click Save to apply the changes.
    

                   ![](https://support.icompaas.com/assets/kb/2f6ab62a04c1af0a.png)

7.  Verify the updated flag under the Database Flags section
    

               ![](https://support.icompaas.com/assets/kb/62de5f969d2695d5.png).

#### Using Google Cloud CLI:

Set the log\_error\_verbosity flag for each PostgreSQL instance:

gcloud sql instances patch <INSTANCE\_NAME> --database-flags log\_error\_verbosity=<TERSE|DEFAULT>

1.  Note: This command overwrites all previously set flags. To retain existing flags, include their values in the command.
    

### **Backout Plan:**

1.  Revert the Flag to Default (if needed):
    -   If changes need to be reversed, set the log\_error\_verbosity flag back to the previous setting (e.g., TERSE or DEFAULT).

#### **Using Google Cloud Console:**

-   Navigate to the Cloud SQL Instances page.
-   Select the PostgreSQL instance to edit.
-   Click Edit.
-   Scroll to the Flags section and modify the log\_error\_verbosity flag to DEFAULT.
-   Save the changes and restart the instance

#### **Using Google Cloud CLI:**

gcloud sql instances patch \[INSTANCE\_NAME\] --database-flags log\_error\_verbosity=DEFAULT

-   Restart the instance for changes to take effect.

### References:

1.  [Google Cloud SQL - Database Flags](https://cloud.google.com/sql/docs/postgres/flags)
    
2.  [PostgreSQL Documentation - Log Error Verbosity](https://www.postgresql.org/docs/current/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT)
    

Additional Information:

-   Configuring this flag does not require restarting the Cloud SQL instance.
    
-   Some database flag configurations may affect availability or stability and remove the instance from the Cloud SQL SLA. Review [Operational Guidelines](https://cloud.google.com/sql/docs/postgres/flags) for more details.
    

CIS Controls:

<table style="border:none;border-collapse:collapse"><tbody><tr style="height:39.25pt;font-family:&quot;Helvetica Neue&quot;"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;text-align:center;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-family:&quot;Helvetica Neue&quot;"><span style="font-weight:700;font-family:&quot;Helvetica Neue&quot;">Control</span></span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;text-align:center;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-family:&quot;Helvetica Neue&quot;"><span style="font-weight:700;font-family:&quot;Helvetica Neue&quot;">Description</span></span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;text-align:center;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-family:&quot;Helvetica Neue&quot;"><span style="font-weight:700;font-family:&quot;Helvetica Neue&quot;">IG 1</span></span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;text-align:center;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-family:&quot;Helvetica Neue&quot;"><span style="font-weight:700;font-family:&quot;Helvetica Neue&quot;">IG 2</span></span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;text-align:center;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-family:&quot;Helvetica Neue&quot;"><span style="font-weight:700;font-family:&quot;Helvetica Neue&quot;">IG 3</span></span></span></span></p></td></tr><tr style="height:53.5pt;font-family:&quot;Helvetica Neue&quot;"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-family:&quot;Helvetica Neue&quot;"><span style="font-family:&quot;Helvetica Neue&quot;">8.5 Collect Detailed Audit Logs</span></span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;"><span style="font-size:14px"><strong><span style="font-family:Helvetica Neue"><span style="font-family:&quot;Helvetica Neue&quot;"><span style="font-weight:400;font-family:&quot;Helvetica Neue&quot;">Configure audit logs with details such as event source, date, user, timestamp, and other useful elements for forensic investigations.</span></span></span></strong></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;"><span style="font-size:14px"><strong><span style="font-family:Helvetica Neue"><span style="font-family:&quot;Helvetica Neue&quot;"><span style="font-weight:400;font-family:&quot;Helvetica Neue&quot;">✅</span></span></span></strong></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;"><span style="font-size:14px"><strong><span style="font-family:Helvetica Neue"><span style="font-family:&quot;Helvetica Neue&quot;"><span style="font-weight:400;font-family:&quot;Helvetica Neue&quot;">✅</span></span></span></strong></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><span style="font-size:14px"><strong><span style="font-family:Helvetica Neue"><span style="font-family:&quot;Helvetica Neue&quot;"><br style="font-family:&quot;Helvetica Neue&quot;"></span></span></strong></span></td></tr><tr style="height:53.5pt"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-family:&quot;Helvetica Neue&quot;"><span style="font-family:&quot;Helvetica Neue&quot;">6.3 Enable Detailed Logging</span></span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="font-family:&quot;Helvetica Neue&quot;"><span style="font-family:&quot;Helvetica Neue&quot;">Enable system logging with detailed information to assist with troubleshooting and security incident analysis.</span></span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;"><span style="font-size:14px"><strong><span style="font-family:Helvetica Neue"><span style="font-family:&quot;Helvetica Neue&quot;"><span style="font-weight:400;font-family:&quot;Helvetica Neue&quot;">✅</span></span></span></strong></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;"><span style="font-size:14px"><strong><span style="font-family:Helvetica Neue"><span style="font-family:&quot;Helvetica Neue&quot;"><span style="font-weight:400;font-family:&quot;Helvetica Neue&quot;">✅</span></span></span></strong></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word"><span style="font-size:14px"><strong><span style="font-family:Helvetica Neue"><br></span></strong></span></td></tr></tbody></table>

  

  

  

  

-

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
