Skip to main content
Version: Latest

Logging Parameters

Logging in a9s PostgreSQL is reduced to a minimum by default. This is, to give most of the performance and, especially, diskspace to the customer. Additionally it reduces the problems that can appear if queries are failing for any reasons.

The parameters that can be configured are the following:

client_min_messages

Controls which message levels are sent to the client. Valid values (in order of details) are:

Log LevelVerbosity
DEBUG5Most
DEBUG4
DEBUG3
DEBUG2
DEBUG1
LOG
NOTICEDefault for a9s PostgreSQL
WARNING
ERROR
FATAL
PANICLeast

log_error_verbosity

Controls the amount of detail written in the server log for each message that is logged. Valid values are TERSE, DEFAULT and VERBOSE, each adding more fields to displayed messages.

info

TERSE excludes the logging of DETAIL, HINT, QUERY, and CONTEXT error information. VERBOSE output includes the SQLSTATE error code and the source code file name, function name, and line number that generated the error.

The default for a9s PostgreSQL is TERSE.

More information about logging can be found in the Error Reporting and Logging section of the PostgreSQL Documentation.

log_min_duration_statement

Causes the duration of each completed statement to be logged if the statement ran for at least the specified amount of time. For more information, see the official PostgreSQL Documentation.

An integer value greater than or equal to -1 is expected. The value -1 disables logging statement durations. The value 0 prints all statement durations.

The default value is -1.

loglevel

Configures the overall loglevel for the control scripts and components from anynines. Valid levels are INFO or DEBUG.

The default for a9s PostgreSQL is DEBUG.

log_statement

Controls which SQL statements are logged. Valid values are none (off), ddl, mod, and all (all statements).

info

ddl logs all data definition statements, such as CREATE, ALTER and DROP statements. mod logs all ddl statements, plus data-modifying statements such as INSERT, UPDATE, DELETE, TRUNCATE, and COPY FROM. PREPARE, EXECUTE and EXPLAIN ANALYZE statements are also logged if their contained command is of an appropriate type.

For clients using extended query protocol, logging occurs when an Execute message is received, and values of the bind parameters are included (with any embedded single-quote marks doubled).

The default for a9s PostgreSQL is none.

pg_log_min_error_statement

Controls which SQL statements that cause an error condition are recorded in the server log. The current SQL statement is included in the log entry for any message of the specified severity or higher. Valid values are:

  • DEBUG5
  • DEBUG4
  • DEBUG3
  • DEBUG2
  • DEBUG1
  • INFO
  • NOTICE
  • WARNING
  • ERROR
  • LOG
  • FATAL
  • PANIC

The default for a9s PostgreSQL is ERROR, which means statements causing errors, log messages, fatal errors, or panics will be logged. To effectively turn off logging of failing statements, set this parameter to PANIC.

pg_log_min_messages

Controls which message levels are written to the server log. Valid values are:

  • DEBUG5
  • DEBUG4
  • DEBUG3
  • DEBUG2
  • DEBUG1
  • INFO
  • NOTICE
  • WARNING
  • ERROR
  • LOG
  • FATAL
  • PANIC

Each level includes all the levels that follow it. The later the level, the fewer messages are sent to the log.

info

DEBUG will produce a substantial amount of log output

The default for a9s PostgreSQL is WARNING.

repmgr_loglevel

Controls the log level for repmgr. Possible values are:

  • DEBUG
  • INFO
  • NOTICE
  • WARNING
  • ERR
  • ALERT
  • CRIT
  • EMERG

The default for a9s PostgreSQL is NOTICE.

temp_files

Controls logging of temporary file names and sizes. Temporary files can be created for sorts, hashes, and temporary query results. A log entry is made for each temporary file when it is deleted. A value of zero logs all temporary file information, while positive values log only files whose size is greater than or equal to the specified number of kilobytes.

The default for a9s PostgreSQL is -1, which disables such logging.