log_error_verbosity

A configuration parameter controlling the amount of detail written in the server log

log_error_verbosity is a configuration parameter controlling the amount of detail written in the server log for each message.

log_error_verbosity was added in PostgreSQL 7.4.

Usage

log_error_verbosity can be set to one of these values:

  • terse
  • default
  • verbose

The default value for og_error_verbosity is: default.

Potential gotcha

If changing log_error_verbosity with the ALTER SYSTEM command, note that:

ALTER SYSTEM SET log_error_verbosity TO default

will (as per the normal behaviour of ALTER SYSTEM) result in log_error_verbosity being removed from postgresql.auto.conf. This means the most recent configuration file entry for log_error_verbosity, if present, will be activated.

Use the following syntax instead:

ALTER SYSTEM SET log_error_verbosity TO 'default'

See also example below.

Default value

The default value for log_error_verbosity is: DEFAULT.

Change history

Examples

Sample log output with log_error_verbosity set to DEFAULT:

[2020-12-23 12:58:39 CET] [unknown] [unknown] [unknown] LOG:  connection received: host=::1 port=55184
[2020-12-23 12:58:39 CET] [unknown] postgres postgres LOG:  connection authorized: user=postgres database=postgres application_name=psql
[2020-12-23 12:58:41 CET] psql postgres postgres LOG:  statement: SELECT 1;
[2020-12-23 12:58:42 CET] psql postgres postgres LOG:  disconnection: session time: 0:00:02.196 user=postgres database=postgres host=::1 port=55184

The same sequence with log_error_verbosity set to VERBOSE:

[2020-12-23 12:59:58 CET] [unknown] [unknown] [unknown] LOG:  00000: connection received: host=::1 port=54750
[2020-12-23 12:59:58 CET] [unknown] [unknown] [unknown] LOCATION:  BackendInitialize, postmaster.c:4395
[2020-12-23 12:59:58 CET] [unknown] postgres postgres LOG:  00000: connection authorized: user=postgres database=postgres application_name=psql
[2020-12-23 12:59:58 CET] [unknown] postgres postgres LOCATION:  PerformAuthentication, postinit.c:303
[2020-12-23 12:59:59 CET] psql postgres postgres LOG:  00000: statement: SELECT 1;
[2020-12-23 12:59:59 CET] psql postgres postgres LOCATION:  exec_simple_query, postgres.c:1044
[2020-12-23 12:59:59 CET] psql postgres postgres LOG:  00000: disconnection: session time: 0:00:01.367 user=postgres database=postgres host=::1 port=54750
[2020-12-23 12:59:59 CET] psql postgres postgres LOCATION:  log_disconnections, postgres.c:4745

Note that ALTER SYSTEM set log_error_verbosity TO DEFAULT may not have the expected effect:

postgres=# SHOW log_error_verbosity ;
 log_error_verbosity
---------------------
 verbose
(1 row)

postgres=# ALTER SYSTEM set log_error_verbosity TO default;
ALTER SYSTEM

postgres=# SELECT pg_reload_conf();
 pg_reload_conf
----------------
 t
(1 row)

postgres=# SHOW log_error_verbosity ;
 log_error_verbosity
---------------------
 verbose
(1 row)

To apply the literal value default, execute:

postgres=# ALTER SYSTEM SET log_error_verbosity TO 'default';
ALTER SYSTEM

postgres=# SELECT pg_reload_conf();
 pg_reload_conf
----------------
 t
(1 row)

postgres=# SHOW log_error_verbosity ;
 log_error_verbosity
---------------------
 default
(1 row)

Categories

GUC configuration item, Logging