# Ensure server parameter 'log_disconnections' is set to 'ON' for PostgreSQL Database Server

- Source: https://support.icompaas.com/support/solutions/articles/62000229888-ensure-server-parameter-log-disconnections-is-set-to-on-for-postgresql-database-server
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [General](https://support.icompaas.com/support/solutions/62000037933) › [Azure Compliance / Control / Check](https://support.icompaas.com/support/solutions/folders/62000168797)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

Description:

The log\_disconnections server parameter in PostgreSQL controls whether the database logs successful client disconnections. Enabling this parameter allows database administrators to track when sessions are terminated, providing a complete audit trail of database connections alongside log\_connections. This is critical for auditing, security monitoring, and troubleshooting Azure PostgreSQL Database Servers (Single or Flexible).

  

Rationale:

-   Security Monitoring: Complements log\_connections by providing a full session lifecycle, helping detect abnormal session terminations or unauthorized access patterns.
    
-   Audit & Compliance: Supports regulatory and internal auditing requirements by maintaining records of all connection/disconnection events.
    
-   Troubleshooting: Useful for diagnosing session-related issues and unexpected application disconnects.
    

  

Impact:

-   Full visibility into connection lifecycle events for compliance and operational monitoring.
    
-   Supports security audits and incident investigations.
    
-   Enhances troubleshooting capabilities for session-related problems.
    
-   Increases log volume, especially in high-traffic environments; proper log rotation and storage management are required.
    
-   Minimal performance overhead for logging disconnections; typically negligible in Azure-managed PostgreSQL.
    

  

Default Value:

-   For Azure Database for PostgreSQL Flexible Server, log\_disconnections is ON by default
    

  

Pre-requisites:

-   Global Administrator or Security Administrator permissions.
    
-   Must be Azure Database for PostgreSQL – Flexible Server (or Single Server if the parameter is supported).
    

  

Test Plan:

1.  Sign in to the Azure Portal at [https://portal.azure.com](https://portal.azure.com/)
    
2.  Search for and open the Azure Database for PostgreSQL server
    
3.  Select the target PostgreSQL server
    
4.  From the left menu, under settings, select Server parameters
    
5.  Search for the parameter log\_disconnections
    
6.  Verify log\_disconnections is set to ON
    
7.  If log\_disconnections is not set to ON, follow the implementation steps
    

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

  

Implementation Steps:

1.  Sign in to the Azure Portal at [https://portal.azure.com](https://portal.azure.com/)
    
2.  Search for your Azure Database for PostgreSQL server.
    
3.  On the left-hand menu, under the Settings section, select server parameters.
    

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

4.  Search for log\_disconnections. 
    
5.  Set the value to ON
    

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

6.  Save the changes.
    

  

Backout Plan:

1.  Log in to the Azure Portal.
    
2.  Search for your Azure Database for PostgreSQL server (Single or Flexible).
    
3.  On the left-hand menu, under the Settings section, select server parameters.
    
4.  Search for log\_disconnections. 
    
5.  Set the value to OFF.
    
6.  Save the changes.
    

  

Reference:

-   [https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-server-parameters](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-server-parameters)

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