본문으로 건너뛰기

log_disconnections

버전기본값context타입
14offsuperuserboolean
15offsuperuserboolean
16offsuperuserboolean
17offsuperuserboolean
18offsuperuserboolean
19offsuperuserboolean

세션 종료를 log에 남긴다. 세션이 유지된 시간도 함께 기록된다.

출력되는 정보는 log_connections와 비슷하고, 여기에 session duration이 추가된다. 세션 시작 시에만 설정할 수 있고 세션 도중에는 바꿀 수 없으며, superuser이거나 적절한 SET 권한이 있어야 한다. 기본값은 off다.

운영 노트: log_connections와 짝으로 켜면 세션의 수명 분포를 분석할 수 있다. 수 초짜리 짧은 세션이 대량으로 보인다면 connection pooling 도입을 검토할 신호다.

출처: PostgreSQL 18 문서