The information stored in log files can prove invaluable when diagnosing or troubleshooting problems. With the help of the information stored in the log files, you can identify the sources of the problems in the underlying database. For this very reason, it is important to preserve log files rather than discarding them. However, the information in the log files tends to be voluminous, so it important that a rotation policy be implemented in order to preserve certain log files and to discard log files that are no longer required. Log files need to be rotated so that new log files are started and old ones are removed after a reasonable period of time.
There are various mechanisms through which logging information is maintained and preserved in log files. These are discussed as follows:
One way to deal with this is to send the server's stderr output to some kind of log rotation program. PostgreSQL has a built-in log rotation facility, which can be used by...