Where are PostgreSQL logs stored?

Better Stack Team
Updated on October 5, 2023

PostgreSQL stores logs in the log files. Depending on your system, you can find the logs at the following locations:

Ubuntu

On Ubuntu and Ubuntu-like systems, the PostgreSQL log is stored in the /var/log/postgresql directory.

OSX Homebrew

On latest OSX Homebrew, logs are stored at /opt/homebrew/var/log/postgres.log