Updated on 2024-06-03 GMT+08:00

Logging Time

client_min_messages

Parameter description: Specifies which level of messages will be sent to the client. Each level covers all the levels following it. The lower the level is, the fewer messages are sent.

This is a USERSET parameter. Set it based on instructions provided in Table 1.

A same value for client_min_messages and log_min_messages does not indicate the same level.

Value range: enumerated type. The valid values are debug, debug5, debug4, debug3, debug2, debug1, info, log, notice, warning, error, fatal and panic. Among them, debug and debug2 are equivalent. For details about the parameters, see Table 1. If the configured level is higher than error, for example, fatal or panic, the system changes the level to error by default.

Default value: notice

log_min_messages

Parameter description: Specifies the level of messages written to CN and DN log files in the server log folder. Each level covers all the levels following it. The lower the level is, the fewer messages will be written into the log.

A same value for client_min_messages and log_min_messages does not indicate the same level.

Value type: enumerated type

Unit: none

Value range: debug, debug5, debug4, debug3, debug2, debug1, info, log, notice, warning, error, fatal and panic. Among them, debug and debug2 are equivalent. For details about the parameters, see Table 1.

Default value: warning

Setting method: This is a SUSET parameter. Set it based on instructions provided in Table 1.

log_min_error_statement

Parameter description: Controls which SQL statements that cause an error condition are recorded in the server log.

This is a SUSET parameter. Set it based on instructions provided in Table 1.

Value range: enumerated values. Valid values are debug, debug5, debug4, debug3, debug2, debug1, info, log, notice, warning, error, fatal, and panic. For details about the parameters, see Table 1.

  • The default is error, indicating that statements causing errors, log messages, fatal errors, or panics will be logged.
  • panic indicates that this feature is disabled.

Default value: error

log_min_duration_statement

Parameter description: Specifies the threshold for logging the duration of a completed statement. The duration of each completed statement is logged if the statement ran for at least the specified number of milliseconds.

Setting log_min_duration_statement makes it easy to trace query statements that need to be optimized. For clients using extended query protocols, the time required for parsing, binding, and executing steps are logged independently.

Parameter type: integer.

Unit: ms

When you use this option together with log_statement, the text of statements that have been logged by log_statement will not be repeatedly logged. If you are not using syslog, it is recommended that you log the process ID (PID) or session ID using 16.3.9.3-log_line_prefix so that you can link the statement message to the latest duration message.

Value range: –1 to 2147483647

  • If this parameter is set to 250, all SQL statements that run for 250 ms or longer will be logged.
  • 0 indicates that the execution durations of all the statements are logged.
  • –1 indicates that the duration logging is disabled.

Default value: 3000ms (that is, 3s)

Setting method: This is a SUSET parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

backtrace_min_messages

Parameter description: Prints the function's stack information to the server's log file if the information generated is greater than or equal to the level specified by this parameter.

This is a SUSET parameter. Set it based on instructions provided in Table 1.

This parameter is used to locate problems on site. Frequent stack printing will affect the system's overhead and stability. Therefore, set this parameter to a value other than fatal or panic during problem locating.

Value range: enumerated values

Valid values are debug, debug5, debug4, debug3, debug2, debug1, info, log, notice, warning, error, fatal, and panic. For details about the parameters, see Table 1.

Default value: panic

Table 1 explains message severities used by GaussDB. If logging output is sent to syslog or eventlog, severity is translated in GaussDB as shown in the table.

Table 1 Message severity levels

Severity

Description

System Log

Event Log

debug[1-5]

Provides detailed debug information.

DEBUG

INFORMATION

log

Reports information of interest to administrators, for example, checkpoint activity.

INFO

INFORMATION

info

Provides information implicitly requested by users, for example, output from VACUUM VERBOSE.

INFO

INFORMATION

notice

Provides information that might be helpful to users, for example, truncation of long identifiers and index created as part of the primary key.

NOTICE

INFORMATION

warning

Provides warnings of likely problems, for example, COMMIT outside a transaction block.

NOTICE

WARNING

error

Reports an error that causes a command to terminate.

WARNING

ERROR

fatal

Reports the reason that causes a session to terminate.

ERR

ERROR

panic

Reports an error that caused all database sessions to terminate.

CRIT

ERROR