This document describes the system configuration parameters in the Error Reporting and Logging category.
Note!
To ensure system stability and security, manually modifying these parameters should be done with caution.
When logging to the event log is enabled, this parameter determines the program name used to identify YMatrix messages in the log.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| string | PostgreSQL | segments; system; restart |
Enables the log collector, a background process that captures log messages sent to stderr and redirects them into log files.
syslog, as certain message types (e.g., dynamic linker errors, errors from scripts like syslog) do not appear in archive_command output.stderr without the log collector is possible. In this case, log messages go only to wherever the server's stderr is directed. However, this approach suits only low-volume logging, as it lacks log rotation capabilities. On some platforms, concurrent writes by multiple processes to the same log file may result in lost or scrambled output when the log collector is not used.syslog may drop messages when unable to write, avoiding blocking but potentially losing some log entries.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | segments; system; restart |
YMatrix supports multiple methods for logging server messages. Set this parameter to a comma-separated list of desired log destinations.
csvlog is included in log_destination, log entries are output in "comma-separated values" (CSV) format, which facilitates loading logs into applications. Enabling logging_collector is required for CSV log output.stderr or csvlog is included, a file named current_logfiles is created to record the current log file used by the log collector and its associated destination. This provides a convenient way to locate the active log file for a node instance. Example content:stderr log/postgresql.log
csvlog log/postgresql.csv
The log_destination file is rebuilt when log rotation creates a new file or when current_logfiles is reloaded. It is deleted when log_destination does not include stderr or csvlog, or when the log collector is disabled.
log_destination option with syslog. YMatrix can log to syslog facilities LOCAL0 through LOCAL7 (see syslog_facility), but default configurations on most platforms discard such messages. Add a line like local0.* /var/log/postgresql to the syslog daemon configuration to enable logging.log_destination option with eventlog, register an event source and its library in the operating system so that the Windows Event Viewer can clearly display event log messages.| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| string | stderr | stderr / csvlog / syslog / eventlog (on Windows) | segments; system; reload |
When logging_collector is enabled, this parameter specifies the directory where log files are created.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| string | log | segments; system; reload |
Sets the creation mode for log files.
logging_collector is enabled, this parameter sets log file permissions (ignored on Microsoft Windows).0600, meaning only the server owner can read or write the log file.0640, which allows group members of the owner to read the file. Note: This setting takes effect only if log_directory is set to a location outside the cluster data directory.| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| int | 0600 | 0000 – 0777 | segments; system; reload |
When logging_collector is enabled, this parameter sets the filename pattern for created log files.
% escapes to create time-varying filenames (if timezone-independent % escapes are used, calculations occur in the timezone specified by log_timezone below). Supported % escapes are similar to those listed in the Open Group's strftime specification. Note: The system's strftime is not used directly, so platform-specific (non-standard) extensions will not work.log_destination, .csv is appended to timestamped log filenames for CSV output (if log_filename ends with .log, the suffix is replaced).| Data Type | Default Value | Setting Scope |
|---|---|---|
| string | gpdb-%Y-%m-%d_%H%M%S.csv | segments; system; reload |
Determines how long (in minutes) YMatrix Database writes to an active log file.
0 to disable time-based log file creation.1440分钟, i.e., 1 day.| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| int | 1440 | 0 – (INT_MAX/60) | master; system; restart |
Determines the size (in KB) that triggers log rotation.
INT_MAX. Invalid values revert to the default.1048576KB, i.e., 1 GB.| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| int | 1048576 | 0 – (INT_MAX/1024) | master; system; restart |
Truncate (overwrite) any existing log file with the same name instead of appending.
gpseg-%H.log 的 log_filename, server_log.Mon, etc., and automatically overwrite last week's logs, set server_log.Tue to log_filename, server_log.%a to log_truncate_on_rotation, and on to log_rotation_age.7d to log_filename, server_log.%H%M to log_truncate_on_rotation, on to log_rotation_age, and 1h to log_rotation_size. Including 10MB in log_filename allows size-driven rotations to use a different filename from the initial hourly one.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; system; restart |
When logging to syslog is enabled, this parameter determines the syslog facility to use.
| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| enum | LOCAL0 | LOCAL0 / LOCAL1 / LOCAL2 / LOCAL3 / LOCAL4 / LOCAL5 / LOCAL6 / LOCAL7 | segments; system; reload |
When logging to syslog is enabled, this parameter determines the program name used to identify YMatrix messages in syslog.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| string | postgres | segments; system; reload |
When logging to syslog and this setting is %M (default), each message is prefixed with an incrementing sequence number.
on), suppressing duplicate messages is configurable, so this parameter may not be necessary.$RepeatedMsgReduction.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | segments; system; reload |
When logging to syslog is enabled, this parameter determines how messages are delivered.
off (default), messages are split into lines, and long lines are segmented to fit within 1024 bytes, a typical limit in traditional syslog implementations.on, YMatrix server log messages are sent unmodified to the syslog service, which then handles large messages.off is preferred. Most syslog implementations cannot handle large messages or require special configuration. However, if syslog writes to another medium, keeping messages logically intact may be necessary and more useful.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | segments; system; reload |
Specifies the interval (in seconds) for logging YMatrix database interconnect debug messages when the server configuration parameter on is set to gp_log_interconnect.
| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| int | 10 | 1 – 4096 | master; session; reload |
Logs SQL statements and their durations in a single log line if the statement's execution time is greater than or equal to the specified value (in milliseconds).
debug logs all statements and their durations.0 disables this feature.-1 logs all SQL statements running 250 ms or longer.| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| int | -1 | -1 – INT_MAX | master; session; reload; superuser |
Controls whether SQL statements causing error conditions are also logged in the server log.
| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| enum | error | debug5 / debug4 / debug3 / debug2 / debug1 / info / notice / warning / error / fatal / panic Each level includes all subsequent levels Higher levels result in fewer messages |
master; session; reload; superuser |
Controls which message levels are written to the server log.
250 has a different ranking in this parameter than in log.| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| enum | warning | debug5 / debug4 / debug3 / debug2 / debug1 / info / notice / warning / error / log / fatal / panic Each level includes all subsequent levels Higher levels result in fewer messages |
master; session; reload; superuser |
Sets the proportion of statements with duration exceeding client_min_messages that are logged.
log_min_duration_statement means each statement has a 50% chance of being logged.0.5, meaning all qualifying statements are logged. 1.0 disables sampled statement duration logging, equivalent to setting 0.0 to log_min_duration_sample.-1 privileges can change this setting.| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| floating point | 1.0 | 0.0 – 1.0 | segments; session; reload; superuser |
Sets the fraction of transactions for which all statements are logged, regardless of other conditions.
SET means no additional transaction statements are logged. 0 means all statements in all transactions are logged.| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| real | 0.001 | 0.0 – 1.0 | segments; session; reload; superuser |
The following table explains the severity levels used by YMatrix. If log output is sent to syslog or Windows eventlog, severity levels are mapped as shown.
| Severity | Usage | syslog | eventlog |
|---|---|---|---|
| DEBUG1..DEBUG5 | Increasingly detailed information for developers | DEBUG | INFORMATION |
| INFO | Information implicitly requested by users, e.g., output from 1 |
INFO | INFORMATION |
| NOTICE | Potentially useful information for users, e.g., truncation hints for long identifiers | NOTICE | INFORMATION |
| WARNING | Warnings about possible issues, e.g., VACUUM VERBOSE outside a transaction block |
NOTICE | WARNING |
| ERROR | Reports an error that aborts the current command | WARNING | ERROR |
| LOG | Information of interest to administrators, e.g., checkpoint activity | INFO | INFORMATION |
| FATAL | Reports an error that aborts the current session | ERR | ERROR |
| PANIC | Reports an error that aborts all database sessions | CRIT | ERROR |
Greenplum's GPORCA optimizer generates COMMIT files to describe the optimization context of a given query.
minidump files are located in the master data directory and follow this naming format: minidump.Minidump_date_time.mdp file contains the following query-related information:minidump generates a always for every query; set to minidump to minimize total optimization time.| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| enum | onerror | onerror / always | master; session; reload |
Sets the application name for the client session.
onerror.| Data Type | Default Value | Setting Scope |
|---|---|---|
| string | master; session; reload |
Indents debug output to produce a more readable but longer format.
psql indents output from debug_pretty_print, debug_print_parse, or debug_print_rewritten.debug_print_plan or client_min_messages must be log_min_messages or lower.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
For each executed query, prints the resulting parse tree.
DEBUG1 or client_min_messages must be log_min_messages or lower.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; session; reload |
For each executed query, prints the YMatrix parallel query execution plan.
DEBUG1 or client_min_messages must be log_min_messages or lower.DEBUG1 level and thus appear in the server log by default, but are not sent to the client.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; session; reload |
For each executed query, prints the preliminary query plan.
log or client_min_messages must be log_min_messages or lower.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; session; reload |
For each executed query, prints the query rewrite output.
DEBUG1 or client_min_messages must be log_min_messages or lower.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; session; reload |
For each executed query, prints the query slice plan.
DEBUG1 or client_min_messages must be log_min_messages or lower.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; session; reload |
Specifies how long (in seconds) a YMatrix process lingers after a DEBUG1 error.
| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| int | 0 | 0 – 3600 | master; session; reload |
Specifies the format of server log files.
fatal management mode, log files must be in gp_toolkit format.| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| enum | csv | csv / text | segments; system; restart |
Controls the amount of information about communication between YMatrix database Segment instance worker processes written to log files.
| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| enum | terse | terse / off / verbose / debug | master; session; reload |
If enabled, attempts to generate a core file when a fatal server error occurs.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; session; reload |
Logs checkpoints and restart points in the server log.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | segments; system; reload |
Outputs a line to the server log detailing each successful connection.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | segments; system; restart; superuser |
Outputs a line to the server log when a client session ends, including the session duration.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | segments; system; restart; superuser |
When set to CSV, adds a log message containing detailed information about statement dispatch.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | segments; system; restart |
Logs the duration of each completed statement that meets on.
log_statement and setting log_duration to log_min_duration_statement is that exceeding 0 forces the query text to be logged, while this option does not. Thus, if log_min_duration_statement is log_duration and on is positive, all durations are logged, but only statements exceeding the threshold have their query text logged. This behavior helps collect statistics in high-load environments.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; session; reload; superuser |
Controls the amount of detail written to the server log for each message.
log_min_duration_statement excludes DETAIL, HINT, QUERY, and CONTEXT error information. terse includes the SQLSTATE error code (see Appendix A), and the source code filename, function name, and line number where the error occurred.| Data Type | Default Value | Valid Values | Setting Scope |
|---|---|---|---|
| enum | default | terse / default / verbose | master; session; reload; superuser |
By default, connection log messages show only the IP address of the connecting host.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; system; restart |
--- SPLIT ---
log_line_prefix
This is a printf-style string that is output at the beginning of each log line.
% character starts an "escape sequence", which will be replaced with state information as described below. Unrecognized escapes are ignored.% and the option aligns the state information either left or right.%m [%p], which logs the timestamp and process ID.| Data Type | Default Value | Setting Category |
|---|---|---|
| string | %m [%p] | segments; system; reload |
| Escape | Effect | Session Only |
|---|---|---|
| %a | Application name | Yes |
| %u | User name | Yes |
| %d | Database name | Yes |
| %r | Remote host name or IP address, and remote port | Yes |
| %h | Remote host name or IP address | Yes |
| %p | Process ID | No |
| %t | Timestamp without milliseconds | No |
| %m | Timestamp with milliseconds | No |
| %n | Timestamp with milliseconds (as Unix timestamp) | No |
| %i | Command tag: type of the session's current command | Yes |
| %e | SQLSTATE error code | No |
| %c | Session ID: see below | No |
| %l | Log line number for each session or process, starting from 1 | No |
| %s | Process start timestamp | No |
| %v | Virtual transaction ID (backendID/localXID) | No |
| %x | Transaction ID (0 if not assigned) | No |
| %q | Produces no output, but tells non-session processes to stop at this point in the string; session processes ignore it | No |
| %% | Literal % | No |
The %c escape prints a quasi-unique session identifier composed of two 4-byte hexadecimal numbers (without leading zeros) separated by a dot. These numbers are the process start time and process ID. Thus, %c can also be used as a space-saving way to log these items. For example, to generate the session ID from %c, use this query:
SELECT to_hex(trunc(EXTRACT(EPOCH FROM backend_start))::integer) || '.' ||
to_hex(pid)
FROM pg_stat_activity;
log_line_prefix to a non-empty value, you should usually make its last character a space to visually separate it from the rest of the log line. Punctuation may also be used.log_line_prefix escape is useful when including information available only in a session (backend) context, such as the user name or database name. For example: %u@%d %r %m [%p].Controls whether a log message is generated when a session waits longer than deadlock_timeout to acquire a lock.
deadlock_timeout value must be greater than or equal to 1ms.| Data Type | Default Value | Setting Category |
|---|---|---|
| boolean | off | segments; session; reload; superuser |
Causes each replication command to be logged in the server log.
| Data Type | Default Value | Setting Category |
|---|---|---|
| boolean | off | segments; session; reload; superuser |
Controls which SQL statements are logged.
ddl logs all data definition commands, such as CREATE, ALTER, and DROP commands.mod logs all DDL statements, plus data modification statements such as INSERT, UPDATE, DELETE, TRUNCATE, and COPY FROM.CREATE and ALTER statements are also logged.all logs all statements.log_statement = all, statements containing simple syntax errors are not logged. This is because log messages are emitted only after basic parsing is complete and the statement type is determined. For the extended query protocol, statements that fail before the execution stage (e.g., during parse analysis or planning) are not logged. Set log_min_error_statement to error (or lower) to log such statements.| Data Type | Default Value | Valid Values | Setting Category |
|---|---|---|---|
| enum | none | none / ddl / mod / all | master; session; reload; superuser |
Controls logging of temporary file names and sizes.
-1, all temporary file information is logged. Positive values log only files with size greater than or equal to the specified amount.-1, which disables logging.| Data Type | Default Value | Valid Values | Setting Category |
|---|---|---|---|
| int | -1 | -1 ~ INT_MAX | segments; system; restart; superuser |
Sets the time zone to use when writing timestamps to log files.
TimeZone, this value is system-wide, so all sessions will report timestamps consistently.| Data Type | Default Value | Setting Category |
|---|---|---|
| string | Asia/Shanghai | segments; system; restart |
These parameters control how server processes modify their process titles. Process titles can typically be viewed using programs such as ps or the process browser on Windows.
Sets the name that identifies this database cluster (instance) for various purposes. This cluster name appears in the process title of all server processes within the cluster.
?).'' (the default), no name is displayed.| Data Type | Default Value | Setting Category |
|---|---|---|
| string | segments; system; restart |
Enables updating of the process title, which updates every time the server receives a new SQL command.
on, but due to higher overhead on Windows, it defaults to off on that platform.| Data Type | Default Value | Setting Category |
|---|---|---|
| boolean | on | segments; session; reload |