Help Center > > Developer Guide> Setting GUC Parameters> Error Reporting and Logging> Logging Time

Logging Time

Updated at: Jul 15, 2020 GMT+08:00

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 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: notice

log_min_messages

Parameter description: Specifies which level of messages are written to the server log. Each level covers all the levels following it. The later the level, the fewer messages are sent to the log.

Type: SUSET

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

Valid values: 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: warning

log_min_error_statement

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

Type: SUSET

Valid values: 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: This feature is disabled.

Default value: error

log_min_duration_statement

Parameter description: Specifies the threshold for logging statement execution durations. The execution duration that is greater than the specified value will be logged.

This parameter helps track query statements that need to be optimized. For clients using extended query protocol, durations of the Parse, Bind, and Execute are logged independently.

Type: SUSET

If this parameter and log_statement are used at the same time, statements recorded 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, it is recommended that you log the process ID (PID) or session ID using log_line_prefix so that you can link the current statement message to the last logged duration.

Value range: an integer ranging from -1 to INT_MAX. The unit is ms.

  • If this parameter is set to 250, execution durations of SQL statements that run 250 ms or longer will be logged.
  • 0: Execution durations of all the statements are logged.
  • –1: This feature is disabled.

Default value: 30 min

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

This parameter is used for locating customer on-site problems. Because frequent stack printing will affect the system's overhead and stability, therefore, when you locate the onsite problems, set the value of this parameter to ranks other than fatal and panic.

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 severity used by 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: SUSET

This parameter value is in milliseconds. You are advised to set this parameter to a value that is 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 externally.

Value range: a number ranging from 0 to 2147483647. The unit is ms.

  • 0 indicates that the current session will not output performance log data.
  • A value other than 0 indicates the output interval of performance log data. The smaller the value is, the more log data is output, resulting in more negative impact on the performance.

Default value: 3s

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel