# Enable log_connections Parameter on Azure PostgreSQL Servers for Connection Tracking and Security Auditing

- Source: https://support.icompaas.com/support/solutions/articles/62000234793-enable-log-connections-parameter-on-azure-postgresql-servers-for-connection-tracking-and-security-aud
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [Azure Database Services Benchmark v1.0.0](https://support.icompaas.com/support/solutions/62000112693) › [Azure Database Services Benchmark](https://support.icompaas.com/support/solutions/folders/62000169261)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

**Profile Applicability:**

-   **Level 1**  
    

**Description:** The log\_connections parameter in PostgreSQL controls whether a log entry is made each time a new connection is established to the database. Enabling this setting helps administrators track connection attempts, providing visibility into who is connecting to the database.

**Rationale:** Logging connections can help identify unusual access patterns or unauthorized access attempts, which is valuable for security auditing and forensic investigation. Enabling log\_connections is essential for monitoring access to sensitive databases.

**Impact:**

-   Pros:  
    
    -   Provides visibility into who is accessing the database and when.  
        
    -   Useful for detecting unauthorized access and performing audits.  
        
    -   Assists in identifying issues related to connection handling or resource usage.  
        
-   Cons:  
    
    -   Increased log size, which may require additional storage or management.  
        
    -   May generate a large volume of logs on high-traffic servers, potentially impacting performance if not managed properly.  
        

Default Value:

-   By default, log\_connections is set to OFF.
    

**Pre-requisites:**

-   Ensure that PostgreSQL is configured to store and manage logs effectively to prevent performance issues.  
    

**Remediation**

**Test Plan:**

**Using Azure Portal:**

1.  Log in to Azure Portal: [https://portal.azure.com](https://portal.azure.com/).  
    
2.  Navigate to Azure Database for PostgreSQL Servers.  
    
3.  Select the relevant server.  
    
4.  Under Settings, click on Server parameters.  
    
5.  Ensure that the log\_connections parameter is set to ON.
    

**Using Azure CLI:**1\. Run the following command to check the log\_connections parameter:

az postgres server show --resource-group <resource-group-name> --name <server-name> --query "properties.parameters.log\_connections"

-   The output should indicate ON.  
    

**Implementation Plan:**

**Using Azure Portal:**

1.  Navigate to Azure Database for PostgreSQL Servers.  
    
2.  Select the server and go to Server parameters.  
    
3.  Set the log\_connections parameter to ON and click Save.
    

**Using Azure CLI:**1\.  To enable log\_connections, run the following command:

az postgres server configuration set --resource-group <resource-group-name> --server-name <server-name> --name log\_connections --value ON

  

**Backout Plan:**

**Using Azure Portal:**

1.  Go to Azure Database for PostgreSQL Servers.  
    
2.  Select the server and navigate to Server parameters.  
    
3.  Set log\_connections back to OFF if necessary.
    

**Using Azure CLI:**1.  To disable log\_connections, run the following command:

az postgres server configuration set --resource-group <resource-group-name> --server-name <server-name> --name log\_connections --value OFF

  

**References:**

-   [Azure PostgreSQL Server Configuration  
    ](https://docs.microsoft.com/en-us/azure/postgresql/howto-configure-server-parameters-using-portal)
    
-   [PostgreSQL Server Configuration for Logging](https://www.postgresql.org/docs/current/runtime-config-logging.html)

## 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.
