Log Files

By default, the postmaster process sends logging information to stdout. However, it is common to redirect output to a specified log file.

>postmaster -D /usr/local/pgsql/data >pglog 2>&1 & 

This will redirect the stdout of the postmaster process to the file named pglog and will also redirect the stderr facility of postmaster to stdout (which is then itself redirected to the specified log file).

This type of arrangement is convenient but presents some long-term problems:

  • Log files tend to grow very large if untended.

  • The system log files and the database log files would reside in separate areas. This can make debugging system failures problematic.

  • It is difficult to redirect these log files to an external “logging” server designed for ...

Get PostgreSQL Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.