This document describes the parameters related to error reporting and log categories in system configuration parameters.
Notes!
To ensure the stability and security of the system, please be sure to manually modify the relevant parameters**.
When logging to event is enabled, this parameter determines the program name used to identify the YMatrix message in the log.
Data Type | Default | Set Category |
---|---|---|
string | PostgreSQL | segments; system; restart |
This parameter enables the log collector, which is a background process that captures log messages sent to stderr
and it redirects those messages to the log file.
syslog
, because certain types of messages do not appear in the syslog
output (such as dynamic linker error messages, error messages generated by scripts such as archive_command
, etc.).stderr
without using the log collector. Log messages will only go to the location where stderr
is directed to the server. However, that approach is only suitable for low log volumes, as it does not provide a way to rotate log files. Also, on some platforms that do not use log collectors, log output may be lost or confusing, because multiple processes will overwrite each other's output when writing to the same log file concurrently.syslog
tends to drop messages when they cannot be written, meaning that in such cases it may not be able to log certain messages, but it does not block other parts of the system.Data Type | Default | Set Category |
---|---|---|
boolean | on | segments; system; restart |
YMatrix supports multiple methods to log server messages, setting this parameter to a list of desired log destinations, separated by commas.
csvlog
is included in log_destination
, the log entry will be output in the "comma-separated values" (CSV) format, which makes it easy to load the log into the program. To generate log output in CSV format, logging_collector
must be enabled.stderr
or csvlog
is included, the file current_logfiles
is created to record the location of the log file currently being used by the log collector and the associated log destination. This provides a convenient means of finding the logs currently in use by a node instance. Here is an example of the contents of the file:stderr log/postgresql.log
csvlog log/postgresql.csv
When the rotation effect creates a new log file and log_destination
is overloaded, the current_logfiles
file is rebuilt. When log_destination
does not include stderr
and csvlog
and the log collector is disabled, this file is deleted.
syslog
option of log_destination
. YMatrix can log to syslog facilities LOCAL0
through LOCAL7
(see syslog_facility
), but the default syslog configuration on most platforms discards all such messages. You will need to add the following to the syslog daemon's configuration file to make it work: local0.* /var/log/postgresql
.eventlog
option of log_destination
, you should register an event source and library in the operating system so that the Windows Event Viewer can clearly display event log messages.Data type | Default value | Value range | Setting category |
---|---|---|---|
string | stderr | stderr / csvlog / syslog / eventlog(on Windows) | segments;system;reload |
When logging_collector
is enabled, this parameter determines the directory where log files will be created.
Data type | Default value | Setting category |
---|---|---|
string | log | segments;system;reload |
Set the creation mode for log files.
logging_collector
is enabled, this parameter sets the permissions for log files (this parameter is ignored on Microsoft Windows).0600
, which means that only the server owner can read or write to the log file.0640
, which allows members of the owner's group to read the file. Note: You must modify log_directory
to a location outside the cluster data directory for this setting to take effect.Data type | Default value | Value range | Setting category |
---|---|---|---|
int | 0600 | 0000 ~ 0777 | segments;system;reload |
When logging_collector
is enabled, this parameter sets the filename of the log file that is created.
%
escapes can be used to specify filenames that change based on time (note that if there are any timezone-independent %
escapes, the calculation will be performed in the timezone specified by log_timezone
(see below)). Supported %
escapes are similar to those listed in the Open Organization's strftime documentation. Note that the system's strftime is not used directly, so platform-specific (non-standard) extensions will not work.log_destination
, .csv
will be appended to the timestamp log filename to create CSV format output (if log_filename
ends with .log
, that suffix will be replaced).Data type | Default value | Setting category |
---|---|---|
string | gpdb-%Y-%m-%d_%H%M%S.csv | segments;system;reload |
Specify the time (in minutes) that the YMatrix database writes messages to the activity log file.
0
to disable the creation of new log files based on time.1440 minutes
, which is 1 day.Data type | Default value | Value range | Setting category |
---|---|---|---|
int | 1440 | 0 ~ (INT_MAX/60) | master;system;restart |
Specify the size (in KB) of a single log file that triggers rotation.
INT_MAX
. If an invalid value is specified, the default value is used.1048576KB
, which is 1GB.Data type | Default value | Value range | Setting category |
---|---|---|---|
int | 1048576 | 0 ~ (INT_MAX/1024) | master;system;restart |
Truncate (overwrite) rather than append to any existing log files with the same name.
gpseg-%H.log
will result in 24-hour log files being generated and cyclically overwritten.server_log.Mon
, server_log.Tue
, and so on, and automatically overwrite last week's logs with this week's logs. Then you can: set log_filename
to server_log.%a
, set log_truncate_on_rotation
to on
, and set log_rotation_age
to 7d
.log_filename
to server_log.%H%M
, set log_truncate_on_rotation
to on
, set log_rotation_age
to 1h
, and set log_rotation_size
to 10MB
. Including the %M
character in log_filename
allows for any size-driven rotation to occur, selecting a new filename that differs from the initial filename for each hour.Data Type | Default Value | Setting Category |
---|---|---|
boolean | off | master;system;restart |
When logging to syslog is enabled, this parameter determines the syslog device to use.
Data type | Default value | Value range | Setting category |
---|---|---|---|
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 category |
---|---|---|
string | postgres | segments;system;reload |
When logs are recorded to syslog and this setting is set to on
(default), each message is prefixed with an incrementing sequence number.
$RepeatedMsgReduction
in rsyslog), so this parameter may not be necessary.off
.Data Type | Default Value | Setting Category |
---|---|---|
boolean | on | segments;system;reload |
When logging to syslog is enabled, this parameter determines how messages are delivered to syslog. - When set to on
(default), messages are split into lines, and long lines are also split to fit within 1024 bytes, which is a typical size limit in traditional syslog implementations.
off
, YMatrix server log messages are sent to the syslog service as-is, and the task of handling large messages is handled by the syslog service.on
. This is because most syslog implementations either cannot handle large messages or require special configuration to do so. However, if syslog is ultimately written to some other medium, it is necessary to maintain the logical integrity of the messages (which is also more useful).Data type | Default value | Setting category |
---|---|---|
boolean | on | segments;system;reload |
Specifies the time interval (in seconds) at which YMatrix database interconnect debug messages are logged when the server configuration parameter gp_log_interconnect
is set to debug
.
Data type | Default value | Value range | Setting category |
---|---|---|---|
int | 10 | 1 ~ 4096 | master;session;reload |
If the duration of a statement is greater than or equal to the specified time (in milliseconds), the statement and its duration are recorded in a single log line.
0
will print all statements and their durations.-1
disables this feature.250
, all SQL statements that run for 250
milliseconds or longer will be logged.Data type | Default value | Value range | Setting category |
---|---|---|---|
int | -1 | -1 ~ INT_MAX | master;session;reload;superuser |
Control whether SQL statements that cause errors are still logged in the server log.
Data type | Default value | Value range | Setting category |
---|---|---|---|
enum | error | debug5 / debug4 / debug3 / debug2 / debug1 / info / notice / warning / error / fatal / panic Each level includes all subsequent levels. The later the level, the fewer messages are sent. |
master;session;reload;superuser |
Control which message levels are written to the server log.
log
has a different ranking in this parameter than in client_min_messages
.Data type | Default value | Value range | Setting category |
---|---|---|---|
enum | warning | debug5 / debug4 / debug3 / debug2 / debug1 / info / notice / warning / error / log / fatal / panic Each level includes all subsequent levels. The later the level, the fewer messages are sent. |
master;session;reload;superuser |
Set the proportion of statements whose duration exceeds log_min_duration_statement
that will be logged.
0.5
means there is a 50% chance of logging any given statement.1.0
, which means all sampled statements are logged. 0.0
disables sampling of statement duration logging, equivalent to setting log_min_duration_sample
to -1
.SET
privileges can modify this setting.Data type | Default value | Valid range | Setting category |
---|---|---|---|
floating point | 1.0 | 0.0 ~ 1.0 | segments;session;reload;superuser |
The section where all statements are logged for a transaction, as well as statements logged for other reasons.
0
indicates that no additional statements for the transaction are logged. 1
indicates that all statements for all transactions are logged.Data type | Default value | Value range | Setting category |
---|---|---|---|
real | 0.001 | 0.0 ~ 1.0 | segments;session;reload;superuser |
The following table explains the message severity levels used by YMatrix. If log output is sent to syslog or Windows eventlog, the severity level will be converted as shown in the table.
Severity | Usage | syslog | eventlog |
---|---|---|---|
DEBUG1..DEBUG5 | Provides developers with continuous, more detailed information | DEBUG | INFORMATION |
INFO | Provides information implicitly requested by the user, such as output from VACUUM VERBOSE |
INFO | INFORMATION |
NOTICE | Provides information that may be useful to the user, such as long identifier truncation warnings | NOTICE | INFORMATION |
WARNING | Provides warnings about potential issues, such as COMMIT outside a transaction block |
NOTICE | WARNING |
ERROR | Reports an error that caused the current command to terminate | WARNING | ERROR |
LOG | Reports information that may be of interest to administrators, such as checkpoint activity | INFO | INFORMATION |
FATAL | Reports an error that caused the current session to terminate | ERR | ERROR |
PANIC | Reports an error that caused all database sessions to terminate | CRIT | ERROR |
The Greenplum GPORCA optimizer generates minidump
files to describe the optimization context for a given query.
minidump
file is located in the main data directory and uses the following naming format: Minidump_date_time.mdp
.minidump
file contains the following information related to this query:always
will generate a minidump
for all queries; setting it to onerror
minimizes total optimization time.Data type | Default value | Value range | Setting category |
---|---|---|---|
enum | onerror | onerror / always | master;session;reload |
Set the application name for the client session.
psql
.Data type | Default value | Setting category |
---|---|---|
string | master;session;reload |
Indented debug output produces a more readable but longer output format. - When set, debug_pretty_print
indents the output generated by debug_print_parse
, debug_print_rewritten
, or debug_print_plan
.
client_min_messages
or log_min_messages
must be DEBUG1
or lower.Data Type | Default | Set Category |
---|---|---|
boolean | on | master; session; reload |
For each query executed, the result analysis tree is printed out.
client_min_messages
or log_min_messages
must be DEBUG1
or lower.Data Type | Default | Set Category |
---|---|---|
boolean | off | master; session; reload |
For each executed query, print out the YMatrix parallel query execution plan.
client_min_messages
or log_min_messages
must be DEBUG1
or lower.log
information level, so by default, they appear in the server log but are not sent to the client.Data Type | Default | Set Category |
---|---|---|
boolean | off | master; session; reload |
For each query executed, print out the preliminary query plan.
client_min_messages
or log_min_messages
must be DEBUG1
or lower.Data Type | Default | Set Category |
---|---|---|
boolean | off | master; session; reload |
For each query executed, print out the query rewrite output.
client_min_messages
or log_min_messages
must be DEBUG1
or lower.Data Type | Default | Set Category |
---|---|---|
boolean | off | master; session; reload |
For each query executed, print the query shard plan.
client_min_messages
or log_min_messages
must be DEBUG1
or lower.Data Type | Default | Set Category |
---|---|---|
boolean | off | master; session; reload |
The time (in seconds) of the YMatrix process remaining after a fatal
error occurs.
Data Type | Default Value | Value Range | Set Classification |
---|---|---|---|
int | 0 | 0 ~ 3600 | master; session; reload |
Specifies the format of the server log file.
gp_toolkit
management mode, the log file must be in CSV
format.Data Type | Default Value | Value Range | Set Classification |
---|---|---|---|
enum | csv | csv / text | segments; system; restart |
Controls the amount of information written to the log file about communication between the worker processes of the YMatrix database Segment instance.
Data Type | Default Value | Value Range | Set Classification |
---|---|---|---|
enum | terse | terse / off / verbose / debug | master; session; reload |
If enabled, a core file will be generated in the event of a fatal server error.
Data Type | Default | Set Category |
---|---|---|
boolean | off | master; session; reload |
Causes checkpoints and restart points to be recorded in the server log.
Data Type | Default | Set Category |
---|---|---|
boolean | off | segments; system; reload |
This outputs a line to the server log, detailing each successful connection.- Only the superuser can change this parameter at the beginning of the session, in which it cannot be changed.
Data Type | Default | Set Category |
---|---|---|
boolean | off | segments; system; restart; superuser |
This outputs a line in the server log when the client session terminates and includes the duration of the session.
Data Type | Default | Set Category |
---|---|---|
boolean | off | segments; system; restart; superuser |
When set to on
, this parameter adds a log message with detailed information about statement dispatch.
Data Type | Default | Set Category |
---|---|---|
boolean | off | segments; system; restart |
The duration of each completed statement that causes the record to satisfy log_statement
.
log_duration
and setting log_min_duration_statement
to 0
is that text that exceeds log_min_duration_statement
forced query is logged, but this option does not. Therefore, if log_duration
is on
and log_min_duration_statement
is a positive value, all durations will be recorded, but only statements that exceed the threshold will be recorded in the query text. This behavior helps collect statistics in high load installations.Data Type | Default | Set Category |
---|---|---|
boolean | off | master; session; reload; superuser |
Controls the amount of detailed information written to each recorded message in the server log.
terse
excludes record DETAIL, HINT, QUERY, and CONTEXT error messages. The verbose messages
output includes the SQLSTATE error code (see Appendix A) and the source code file name, function name, and line number that generated the error.Data Type | Default Value | Value Range | Set Classification |
---|---|---|---|
enum | default | terse / default / verbose messages | master; session; reload; superuser |
By default, the connection log message only displays the IP address of the connected host.
| Data Type | Default | Set Category | | --- | --- | --- | --- | | boolean | off | master; system; restart |
This is a printf-style string that outputs at the beginning of each log line. - %
character starts "escape sequence", which will be replaced with status information as described below. Unidentified escapes are ignored.
%
and this option to align the status information left or right.%m [%p]
, which records the timestamp and process ID.Data Type | Default | Set Category |
---|---|---|
string | %m [%p] | segments; system; reload |
Escape | Effect | Session Only |
---|---|---|
%a | Application name | Yes |
%u | Username | Yes |
%d | Database name | Yes |
%r | Remote hostname or IP address, and remote port | Yes |
%h | Remote hostname or IP address | Yes |
%p | Process ID | No |
%t | No millionsecond timestamp | No |
%m | Timestamp with million seconds | No |
%n | Timestamp with million seconds (as Unix timestamp) | No |
%i | Command Tag: The type of the current command in the session | 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 | Timestamp for process start | No |
%v | Virtual Transaction ID (backendID/localXID) | No |
%x | Transaction ID (0 if not allocated) | No |
%q | No output is generated, but tells the non-session process to stop at this point in the string; the session process ignores | No |
%% | Plain text % | No |
%c
escape prints a quasi-unique session identifier consisting of two 4-byte hexadecimal numbers (without leading zeros), separated by dots. These numbers are process startup time and process ID, so %c
can also be used as a space to save the way these items are printed. For example, to generate a session identifier from pg_stat_activity
, use this query:
SELECT to_hex(trunc(EXTRACT(EPOCH FROM backend_start))::integer) || '.' ||
to_hex(pid)
FROM pg_stat_activity;
log_line_prefix
, you should usually have its last character space to provide a visual difference from the rest of the log line. Punctuation marks can also be used.%q
escape is useful when including information that is only available in the context of the session (backend) (such as username or database name). For example:
log_line_prefix = '%m [%p] %q%u@%d/%a '
.Controls whether a log message is to be generated when a session acquires a lock until deadlock_timeout
is exceeded.
log lock waits
must be greater than or equal to deadlock_timeout
.Data Type | Default | Set Category |
---|---|---|
boolean | off | segments; session; reload; superuser |
Causes every [copy command] (https://www.postgresql.org/docs/12/protocol-replication.html) to be recorded in the server log.
Data Type | Default | Set Category |
---|---|---|
boolean | off | segments; session; reload; superuser |
Controls which SQL statements are recorded.
ddl
records all data definition commands, such as CREATE
, ALTER
and DROP
commands; mod
records all DDL statements, as well as data modification statements such as INSERT
, UPDATE
, DELETE
, TRUNCATE
and COPY FROM
. If the included commands are of the appropriate type, the PREPARE
and EXPLAIN ANALYZE
statements are also recorded; all
is all statements.log_statement = all
setting, statements containing simple syntax errors will not be recorded. This is because log messages are only issued after the basic syntax parsing is completed and the statement type has been determined. In the case of extended query protocols, statements that errors before the execution phase (i.e. during parsing analysis or planning) are not recorded either. This statement needs to be recorded by setting log_min_error_statement
to ERROR
(or lower).Data Type | Default Value | Value Range | Set Classification |
---|---|---|---|
enum | none | none / ddl / mod / all | master; session; reload; superuser |
Controls records of temporary file names and sizes.
0
, it means that all temporary file information is recorded, while the positive value only records files with a size greater than or equal to the specified amount of data.-1
, which means logging is disabled.Data Type | Default Value | Value Range | Set Classification |
---|---|---|---|
int | -1 | -1 ~ INT_MAX | segments; system; restart; superuser |
Sets the time zone for the timestamp used to write to the log.
TimeZone
, this value is system-wide, so all sessions will report timestamps consistently.Data Type | Default | Set Category |
---|---|---|
string | Asia/Shanghai | segments; system; restart |
This section of parameters controls how the process title of the server process is modified. Process titles can usually be viewed using programs such as ps
or process browser on Windows.
Set the name that identifies this database cluster (instance) for different purposes. This cluster name appears in the process title of all server processes in the cluster.
Data Type | Default | Set Category |
---|---|---|
string | segments; system; restart |
Enable process title update, and updates the process title every time the server receives a new SQL command.
on
on most platforms, but because it is more expensive to update process titles on Windows, the default is off
on Windows.Data Type | Default | Set Category |
---|---|---|
boolean | on | segments; session; reload |