Tuning logging-related parameters

In this recipe, we will talk about tuning logging-related parameters.

How to do it...

The following are the logging-related parameters that usually require tuning:

  • log_line_prefix
  • log_statement
  • log_min_duration_statement

How it works...

log_line_prefix: Usually the default value related to this parameter is empty and it is not desirable. A good way to put this in context would be to use the following format:

log_line_prefix='%t:%r:%u@%d:[%p]: '

Once this format is used, every line in the log will follow this format. The following is a description of the entries:

  • %t: This is the timestamp
  • %u: This is the database username
  • %r: This is where the remote host connection is from
  • %d: This is where the database connection is to ...

Get PostgreSQL High Performance Cookbook 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.