I turned on the configuration parameter log_planner_stats and would like to examine the details in log. But the log file is empty. It seems all the log files are changed at 12:00am of a day. Does PostgreSQL only writes log at that time? Is there any way to see the real-time log? BTW, I checked the log files in the directory pg_log which I guess is the right directory to find logs.
Postgresql – When does PostgreSQL write logs
postgresql
Related Question
- PostgreSQL – How to Examine Server’s SSL Certificate
- PostgreSQL – Configuring wal_archive Directory for Write-Ahead Logging
- Postgresql – Questions to Continuous Archiving and Point-in-Time Recovery with PostgreSQL
- Postgresql – Unix domain socket “/var/run/postgresql/.s.PGSQL.5432” missing
- PostgreSQL 11 Windows 10 Truncates All Tables on Shutdown
- Postgresql – Problem Installing PostgreSQL 12.1 Win8.1: “the database cluster initialisation failed”
- Postgresql – Why does WAL on postgresql takes so long to replay
- PostgreSQL 11 – Service Doesn’t Start Troubleshooting
Best Answer
No, if PostgreSQL writes logs, then it writes basically real-time. For example, if you open a log file with
less
and press ShiftF, you will get the newly written rows flowing in.That you don't see anything in the logs can be caused by a few things, but first be sure you have read through the relevant documentation and set up everything accordingly. There and in
postgresql.conf
you can also check where the DB writes the logs and so on. Be aware that some configuration options need server restart or DB reload to take effect.