1. 환경설정
$ sudo vim /etc/postgresql/11/main/postgresql.conf
1) log_directory
log_directory = 'log'
2) log_finename
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
3) log_statement
log_statement = 'all'
4) logging_collector
logging_collector = on
5) log_destination
log_destination = 'stderr'
2.PostgreSQL 재시작
$ sudo /etc/init.d/postgresql restart
3. 로그 확인
cd /var/lib/postgresql/11/main/log/
tail -f *.out