apps/docs/content/guides/platform/postgres-connection-logging.mdx
For security monitoring and compliance audits, Postgres can log connection lifecycle events to your project's Postgres logs, including events such as connection received, connection authenticated, and connection authorized.
By default, Supabase sets log_connections to off for new projects and you must enable it first. This behavior matches common managed Postgres defaults and reduces log volume from high-frequency connection events.
Existing projects may retain different settings depending on plan and compliance configuration:
If you need connection audit evidence for SOC 2 or other compliance programs, you must enable it explicitly.
</Admonition>Connection logging supports audit and monitoring controls required by some compliance programs:
Disabling connection logging does not affect other Supabase logging (for example, Platform Audit Logs, Auth Audit Logs, or pgAudit).
You can configure connection logging from the Log connections setting in the Database Settings section of the Dashboard.
Ensure that you have Owner or Admin permissions for the project.
<Admonition type="note">Connection events appear in Postgres logs. In the Logs Explorer, connection lifecycle messages may be hidden by default to reduce noise. Use the connection logs filter in the sidebar to show or hide them.
</Admonition>You can also manage connection logging using the Management API:
# Get your access token from https://supabase.com/dashboard/account/tokens
export SUPABASE_ACCESS_TOKEN="your-access-token"
export PROJECT_REF="your-project-ref"
# Get current Postgres config
curl -X GET "https://api.supabase.com/v1/projects/$PROJECT_REF/config/database/postgres" \
-H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN"
# Enable connection logging
curl -X PUT "https://api.supabase.com/v1/projects/$PROJECT_REF/config/database/postgres" \
-H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"log_connections": true
}'
# Disable connection logging
curl -X PUT "https://api.supabase.com/v1/projects/$PROJECT_REF/config/database/postgres" \
-H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"log_connections": false
}'
To verify the setting, use the SQL Editor:
show log_connections;