Logging

This topic describes how to configure ADPG log settings and view log files.

Configure log settings

Use ADCM to define log settings.

Open the Clusters page and click the ADPG cluster. Open the Services tab and click the ADPG service.

ADPG cluster services
ADPG cluster services

The Primary configuration tab of the ADPG service is opened. Expand the ADPG configurations node and scroll down to the log settings.

ADPG log settings
ADPG log settings

Available log settings are listed in the table.

ADPG log settings
Parameter name Description Default value

logging_collector

Enables the logging collector. The logging collector is a background process that captures log messages sent to stderr and redirects them into log files. If you change this parameter, run the Reconfigure & Restart action to apply changes

The logging collector is enabled (true)

log_directory

Determines the directory that contains log files. It can be specified as an absolute path, or relative to the cluster data directory

log
(the absolute path is /pg_data1/adpg14/log)

log_filename

Specifies the log file name pattern. The value can include strftime %-escapes to define time-varying file names. If you specify a file name pattern without escapes, use a log rotation utility to save disk space

postgresql-%a.log

log_rotation_age

Determines the maximum period of time to use a log file, after which a new log file is created. If this value is specified without units, it is taken as minutes. Set log_rotation_age to 0 to disable time-based log file creation

1d

log_rotation_size

Determines the maximum size of a log file. After a log file reaches the specified size, a new log file is created. If the value is set without units, it is taken as kilobytes. Set log_rotation_size to 0 to disable size-based log file creation

0

log_min_messages

Specifies the minimum severity level of messages that are written to a log file. Valid values are debug5, debug4, debug3, debug2, debug1, info, notice, warning, error, log, fatal, and panic (see the Severity levels table). Messages with the specified severity or higher are included in the log file. For example, if you set log_min_messages to warning, the log file will include the warning, error, log, fatal, and panic messages

warning

log_min_error_statement

Specifies which SQL statements that cause errors are logged. Valid values are debug5, debug4, debug3, debug2, debug1, info, notice, warning, error, log, fatal, and panic (see the Severity levels table). The log file includes SQL statements for messages of the specified severity or higher. To disable error statement logging, set log_min_error_statement to panic

error

Log message severity levels are listed below.

Severity levels
Value Description

Debug1..Debug5

Detailed information for developers. Debug1 — the least detailed information, Debug5 — the most detailed information

Info

Information implicitly requested by a user, for example, output from VACUUM VERBOSE

Notice

Information that can be helpful to users, for example, a notification about truncation of long identifiers

Warning

A warning about a possible problem, for example, COMMIT outside a transaction block

Error

An error that aborts the current command

Log

Information for administrators, for example, checkpoint activity

Fatal

The current session is aborted due to an error

Panic

All database sessions are aborted

If you modify log settings, run the Reconfigure & Restart or Reconfigure & Reload action to apply changes.

The settings listed above are standard PostgreSQL server configuration parameters. For additional information about these settings, see the following topic: Error Reporting and Logging.

CAUTION
When the ADPG service executes the Reconfigure & Restart or Reconfigure & Reload action, postgresql.conf is rewritten with settings specified in Services → ADPG → Configuration. If you make changes directly to postgresql.conf, these changes will be lost.

View log files

You can find logs on the host where ADPG is installed.

  1. Connect to the host (for example, via SSH), run the ls command, and pass a path to the log file directory as a parameter:

    $ sudo ls -la /pg_data1/adpg14/log

    Log files in the specified directory are listed:

    total 10708
    drwx------  2 postgres postgres     136 May 26 00:00 .
    drwx------ 20 postgres postgres    4096 May 26 08:54 ..
    -rw-------  1 postgres postgres    1009 May 20 13:31 postgresql-Fri.log
    -rw-------  1 postgres postgres     596 May 23 06:30 postgresql-Mon.log
    -rw-------  1 postgres postgres 3803084 May 26 10:04 postgresql-Thu.log
    -rw-------  1 postgres postgres     988 May 24 07:37 postgresql-Tue.log
    -rw-------  1 postgres postgres 3343041 May 25 23:59 postgresql-Wed.log
  2. You can use the tail command to view a log file content:

    $ sudo tail /pg_data1/adpg14/log/postgresql-Mon.log

    Result:

    2022-05-23 06:30:40.804 GMT [951] LOG:  starting PostgreSQL 14.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
    2022-05-23 06:30:40.804 GMT [951] LOG:  listening on IPv6 address "::1", port 5432
    2022-05-23 06:30:40.804 GMT [951] LOG:  listening on IPv4 address "127.0.0.1", port 5432
    2022-05-23 06:30:40.813 GMT [951] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
    2022-05-23 06:30:40.845 GMT [1079] LOG:  database system was shut down at 2022-05-20 13:31:40 GMT
    2022-05-23 06:30:40.972 GMT [951] LOG:  database system is ready to accept connections
Found a mistake? Seleсt text and press Ctrl+Enter to report it