Defining what and how to log

After taking a look at some basic settings, it is time to decide what to log. By default, only errors will be logged. However, this might not be enough. In this section, you will learn what can be logged and what a log line will look like.

By default, PostgreSQL does not log information about checkpoints. The following setting is there to change exactly that:

#log_checkpoints = off 

The same applies to connections; whenever a connection is established or properly destroyed, PostgreSQL can create log entries:

#log_connections = off 
#log_disconnections = off 

In most cases, it does not make sense to log connections, as extensive logging significantly slows down the systems. Analytical systems won't suffer much. ...

Get Mastering PostgreSQL 10 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.