Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

log_connections

Focus mode
log_connections - AWS Prescriptive Guidance

The log_connections parameter controls whether connections to the database are logged. When you set this parameter to on, the log contains information about each successful connection to the database, such as the client's IP address, the username, the database name, and the date and time of the connection.

You can use the log_connections parameter to monitor and troubleshoot connections to the database. You can see the users, applications, terminals, and bots that connect to the database, where they're connecting from, and how often. This information can be useful for identifying and resolving connection-related issues or tracking usage patterns.

AWS CLI syntax

The following command changes log_connections for a specific DB parameter group. This change applies to all instances or clusters that use the parameter group.

# Modify log_connections on a DB parameter group aws rds modify-db-parameter-group \ --db-parameter-group-name <parameter_group_name> \ --parameters "ParameterName=log_connections,ParameterValue=<new_value>,ApplyMethod=immediate" # Modify log_connections on a DB cluster parameter group aws rds modify-db-cluster-parameter-group \ --db-cluster-parameter-group-name <parameter_group_name> \ --parameters "ParameterName=log_connections,ParameterValue=<new_value>,ApplyMethod=immediate"

Type: Dynamic (changes are applied immediately if you set ApplyMethod=immediate)

Default value: off (PostgreSQL engine default)

Example

You can use this parameter if you suspect that too many connections to the database, or a specific user or IP address that's connecting too frequently, is affecting performance. By enabling the log_connections parameter and examining the log output, you can see the number and details of all connections.

Before you enable this parameter, check your organization's policies and consider the security implications of logging IP addresses and usernames.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.