Updated on 2026-09-23 GMT+08:00

Logging Time

client_min_messages

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

Type: USERSET

When the values of client_min_messages and log_min_messages are the same, the levels are different.

Valid values: Enumerated values. Valid values: debug5, debug4, debug3, debug2, debug1, info, log, notice, warning, error For details about the parameters, see Table 1.

Default value: notice

log_min_messages

Parameter description: Specifies which level of messages will be written into server logs. Each level covers all the levels following it. The lower the level is, the fewer messages will be written into the log.

Type: SUSET

When the values of client_min_messages and log_min_messages are the same, the levels are different.

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

Default value: warning

log_min_error_statement

Parameter description: Specifies which SQL statements that cause errors condition will be recorded in the server log.

Type: SUSET

Value range: enumerated type. Valid values: debug5, debug4, debug3, debug2, debug1, info, log, notice, warning, error, fatal, 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: This feature is disabled.

Default value: error

log_min_duration_statement

Parameter description: When the execution time of an SQL statement is greater than or equal to the time specified by this parameter, the system automatically records the statement and its actual execution time in database logs. This parameter is used to trace the query statements to be optimized. For clients using the extended query protocol, the time spent on parsing, binding, and executing each step is logged separately.

Type: SUSET

Value range: an integer ranging from –1 to INT_MAX, in milliseconds

  • –1 indicates that this parameter is disabled.
  • 0 indicates that all executed SQL statements and their execution duration are logged.
  • A value greater than 0 indicates that the SQL statements taking longer than the configured duration of the parameter are logged. For example, if this parameter is set to 1000, any statement exceeding 1000 milliseconds of execution time is logged.

Default value: 30min

If this parameter and log_statement are both used, statements logged based on the value of log_statement will not be logged again after their execution duration exceeds the value of this parameter. If you are not using syslog, you are advised to use log_line_prefix to log the PID or session ID to associate the current statement with its final duration message.

backtrace_min_messages

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

Type: SUSET

Value range: enumerated values

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

Default value: panic

This parameter is used to locate faults in actual service scenarios. Frequent printing of function stacks increases system overhead and affects stability. You are advised not to set this parameter to a level other than fatal and panic.

Table 1 explains the message security levels used in DWS. If logging output is sent to syslog or eventlog, severity is translated in DWS as shown in the table.

Table 1 Message Severity Levels

Severity

Description

syslog

eventlog

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 the user, for example, output from VACUUM VERBOSE.

INFO

INFORMATION

notice

Provides information that might be helpful to users, for example, notice of 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

plog_merge_age

Parameter description: Specifies the output interval of performance log data.

Type: USERSET

Value range: an integer ranging from 0 to INT_MAX. The unit is millisecond (ms).

  • 0 indicates that the current session does not output performance log data.
  • A value greater than 0 indicates that the current session exports performance logs at a specified interval. As the value decreases, more log data is generated, which negatively impacts performance.

Default value: 3s

  • The parameter value is in milliseconds. You are advised to set it to a multiple of 1000. That is, the value is in seconds.
  • Name extension of the performance log files controlled by this parameter is .prf. These log files are stored in the $GAUSSLOG/gs_profile/<node_name> directory. node_name is the value of pgxc_node_name in the postgres.conf file.
  • You are advised not to use this parameter.

profile_logging_module

Parameter description: Specifies the type of performance logs. When using this parameter, ensure that the value of plog_merge_age is not 0. This parameter is a session-level parameter, and you are not advised to use the gs_guc tool to set it. Only clusters of 8.1.3 and later versions support this function.

Type: USERSET

Value range: a string

Default value: ALL,on(OBS,HADOOP,REMOTE_DATANODE),off(MD)

Setting method: Run the SHOW profile_logging_module; command to view the modules that can be set. For example, the query output result is as follows:

1
2
3
4
SHOW profile_logging_module;
profile_logging_module
--------------------------------------------
ALL,on(OBS,HADOOP,REMOTE_DATANODE),off(MD)(1 row)

Open the MD performance log and view the setting. ALL indicates that the log output of all modules is enabled or disabled.

1
2
3
4
5
6
7
SET profile_logging_module='on(md)';
SET

SHOW profile_logging_module;
profile_logging_module
---------------------------------------------
ALL,on(MD,OBS,HADOOP,REMOTE_DATANODE),off()(1 row)