Description:
The log_connections server parameter in PostgreSQL controls whether the database logs successful client connection attempts. Enabling this parameter allows database administrators to monitor who is connecting to the server, from which IP addresses, and when. This is critical for auditing, security monitoring, and identifying unauthorized access attempts in Azure PostgreSQL Database Servers (Single or Flexible).
Rationale:
Security Monitoring: Logging connections provides visibility into client access patterns and helps detect unusual or suspicious activity.
Audit & Compliance: Supports regulatory requirements and internal policies for database access auditing (e.g., GDPR, HIPAA, PCI-DSS).
Troubleshooting: Helps diagnose connectivity issues by providing a record of all successful connections.
Impact:
Provides an audit trail of all connections to the PostgreSQL server.
Supports compliance and security reporting.
Enhances visibility into database access and operational activity.
Logging each connection increases log volume, which could impact storage usage if not managed.
Minimal performance overhead is associated with logging; usually negligible for most workloads.
Default Value:
For Azure Database for PostgreSQL (Single and Flexible Servers), the default value for log_connections is ON.
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:
Sign in to the Azure Portal at https://portal.azure.com
Search for and open the Azure Database for PostgreSQL
Select the target PostgreSQL server
From the left menu, select Server parameters
Search for the parameter log_connections
Verify log_connections is set to ON
If log_connections is not set to ON, follow the implementation steps
Implementation Steps:
Sign in to the Azure Portal at https://portal.azure.com
Search for your Azure Database for PostgreSQL server.
On the left-hand menu, under the Settings section, select server parameters.
Search for log_connections.
Set the log_connections value to ON
Save the changes
Backout Plan:
Sign in to the Azure Portal at https://portal.azure.com
Search for your Azure Database for PostgreSQL server.
On the left-hand menu, under the Settings section, select server parameters.
Search for log_connections.
Set the log_connections value to OFF.
Save the changes
Reference:


