- PostgreSQL 10 Administration Cookbook
- Simon Riggs Gianni Ciolli
- 175字
- 2021-06-25 22:03:56
How it works...
The server log is just a file that records messages from the server. Each message has a severity level, the most typical of them being LOG, though there are others, as shown in the following table:

Watch out for FATAL and PANIC. This shouldn't happen in most cases during normal server operation, apart from certain cases related to replication; so check out Chapter 12, Replication and Upgrades, also.
You can adjust the number of messages that appear in the log by changing the log_min_messages server parameter. You can also change the amount of information that is displayed for each event by changing the log_error_verbosity parameter. If the messages are sent to a standard log file, then each line in the log will have a prefix of useful information that can also be controlled by the system administrator, with a parameter named log_line_prefix.
You can also alter the what and the how much that goes into the logs by changing other settings such as log_statements, log_checkpoints, log_connections/log_disconnections, log_verbosity, log_lock_waits, and so on.