O'Reilly logo

PostgreSQL High Performance Cookbook by Dinesh Kumar, Chitij Chauhan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required