DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Reporting and Logging / What to Log

log_error_verbosity

Sets the verbosity of logged messages.

  • Default: default
  • Type: enum
  • Values: terse · default · verbose
  • Applies: Session (superuser)

In plain words

Controls how much extra information comes with each message in the log. terse keeps only the main line; default adds the DETAIL, HINT and CONTEXT lines; verbose also adds the error code and the exact place in PostgreSQL's source code.

For DBAs and operators

Captured on 18.6 for the same SELECT 1/0:

-- terse ERROR: division by zero -- default ERROR: division by zero -- verbose ERROR: 22012: division by zero LOCATION: int4div, int.c:870

terse drops DETAIL, HINT, QUERY and CONTEXT lines (STATEMENT is controlled separately by log_min_error_statement). verbose adds the SQLSTATE code before the message and a LOCATION line (function, file, line), which is very useful when reporting a bug or searching the source code for an unusual message.

You can also get the SQLSTATE in every line with %e in log_line_prefix, without the extra LOCATION lines. CSV and JSON logs always contain all fields (the location columns are filled only with verbose). For the client side, psql has \set VERBOSITY verbose, and \errverbose to re-show the last error in full.

How to change it

A superuser (or a role granted SET) can change it per session with SET.

See it in context

Logger (logging collector)

Related parameters

log_min_messages log_line_prefix log_min_error_statement

All Reporting and Logging parameters