• Data Warehouse Service

dws
  1. Help Center
  2. Data Warehouse Service
  3. Developer Guide
  4. Setting Configuration Parameters
  5. Appendix B: GUC Parameter Description
  6. Error Report and Log
  7. Logging Content

Logging Content

debug_pretty_print

Parameter description: Indents the logs produced by debug_print_parse, debug_print_rewritten, and debug_print_plan. The output format is more readable but much longer than the output generated when this parameter is set to off.

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

Value range: Boolean

  • on indicates the indentation is enabled.
  • off indicates the indentation is disabled.

Default value: on

log_duration

Parameter description: Controls whether to record the duration of every completed SQL statement to be logged. For clients using extended query protocols, the time required for parsing, binding, and executing steps are logged independently.

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

Value range: Boolean

  • If this parameter is set to off, the difference between setting this option and setting log_min_duration_statement is that exceeding log_min_duration_statement forces the text of the query to be logged, but this option does not.
  • If this parameter is set to on and log_min_duration_statement has a positive value, all durations are logged but the query text is included only for statements exceeding the threshold. This behavior can be used for gathering statistics in high-load situation.

Default value: on

log_error_verbosity

Parameter description: Controls the amount of detail written in the server log for each message that is logged.

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

Value range: Enumerated values

  • terse indicates that the output excludes the logging of DETAIL, HINT, QUERY, and CONTEXT error information.
  • verbose indicates that the output includes the SQLSTATE error code, the source code file name, function name, and number of the line in which the error occurs.
  • default indicates that the output includes the logging of DETAIL, HINT, QUERY, and CONTEXT error information, and excludes the SQLSTATE error code, the source code file name, function name, and number of the line in which the error occurs.

Default value: default

log_lock_waits

Parameter description: If the time that a session used to wait a lock is longer than the value of deadlock_timeout, this parameter controls whether to record this message in the database. This is useful in determining if lock waits are causing poor performance.

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

Value range: Boolean

  • on indicates the information is recorded.
  • off indicates the information is not recorded.

Default value: off

log_statement

Parameter description: Specifies whether to record SQL statements. For clients using extended query protocols, logging occurs when an execute message is received, and values of the Bind parameters are included (with any embedded single quotation marks doubled).

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

Statements that contain simple syntax errors are not logged even if log_statement is set to all, because the log message is emitted only after basic parsing has been completed to determine the statement type. If the extended query protocol is used, this setting also does not log statements before the execution phase (during parse analysis or planning). Set log_min_error_statement to ERROR or lower to log such statements.

Value range: Enumerated values

  • none indicates that no statement is recorded.
  • ddl indicates that all data definition statements, such as CREATE, ALTER, and DROP, are recorded.
  • mod indicates that all DDL statements and data modification statements, such as INSERT, UPDATE, DELETE, TRUNCATE, and COPY FROM, are recorded.
  • all indicates that all statements are recorded. The PREPARE, EXECUTE, and EXPLAIN ANALYZE statements are also be recorded.

Default value: none

log_temp_files

Parameter description: Determines whether to record the delete information of temporary files. Temporary files can be created for sorting, hashing, and temporary querying results. A log entry is generated for each temporary file when it is deleted.

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

Value range: an integer with the minimum value -1

  • A positive value indicates that the delete information of temporary files whose values are larger than that of log_temp_files is recorded.
  • If the parameter is set to 0, all the delete information of temporary files is recorded.
  • If the parameter is set to -1, the delete information of any temporary files is not recorded.

Default value: -1

logging_module

Parameter description: Configures or displays whether module logs can be delivered on the server. This parameter is a session-level parameter, and you are not advised to use the gs_guc tool to set it.

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

Value range: a string

Default value: off. All the module logs on the server can be viewed by running show logging_module.

Setting method: First, you can run show logging_module to view which module is controllable. For example, the query output result is as follows:

show logging_module;
logging_module
--------------------------------------------------------
ALL,on(),off(DFS,GUC,HDFS,ORC,SLRU,MEM,CACHE,ADIO,SSL)
(1 row)

Controllable modules are identified by using uppercase letters, and the special ID ALL is used for setting all module logs. You can control module logs to be exported by setting the log modules to on or off. Enable log output for SSL:

set logging_module='on(SSL)';
SET
show logging_module;
logging_module
-------------------------------------------------------
ALL,on(SSL),off(DFS,GUC,HDFS,ORC,SLRU,MEM,CACHE,ADIO)
(1 row)

SSL log output is enabled.

The ALL identifier is equivalent to a shortcut operation. That is, logs of all modules can be enabled or disabled.

set logging_module='off(ALL)';
SET
show logging_module;
logging_module
--------------------------------------------------------
ALL,on(),off(DFS,GUC,HDFS,ORC,SLRU,MEM,CACHE,ADIO,SSL)
(1 row)

set logging_module='on(ALL)';
SET
show logging_module;
logging_module
--------------------------------------------------------
ALL,on(DFS,GUC,HDFS,ORC,SLRU,MEM,CACHE,ADIO,SSL),off()
(1 row)

Dependency: The value of this parameter depends on the settings of log_min_level.