Configuring the amount of log output

In this section, we will discuss how to control the amount of log produced by the database. The default configuration of PostgreSQL provides us only with error messages. Sometimes, this is just not enough. The goal of this section is to provide you with all the information you need to make PostgreSQL more verbose.

The central configuration variable here is log_statements:

log_statement = 'all'             # none, ddl, mod, all

Let's see the description of the variables used in the preceding code snippet:

  • none: In this case, only error messages are logged (syntax errors, panics, fatal errors, and so on).
  • ddl: At this level, we will already log all errors, including all commands that change the data structure (CREATE TABLE ...

Get PostgreSQL Administration Essentials 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.