This document introduces how to manage the retention duration of pg_log.
Introduction to PG_LOG
pg_log typically records the status information of the database, such as error information, slow log SQL, database startup and shutdown information, etc. This log will be automatically segmented by size and time, and the pg_log of TencentDB for PostgreSQL is retained by default for 30 days. pg_log will occupy the storage space of the database instance, and you can modify the retention duration based on your needs.
Note:
The slow log and error log of the database instance are retained for 7 days by default. Modifying the pg_log retention duration does not affect the slow log and error log retention duration.
Modifying PG_LOG Retention Duration
You can modify the pg_log retention duration based on your needs. The system currently supports two options: 7 days and 30 days. The detailed steps are as follows:
2. Find the instance you need to modify in the instance list, click Operation > Management to enter the instance details.
3. Find Parameter Setting in the Instance detail page, search for the parameter log_filename in the upper right corner and update it.
The introduction for the log_filename parameter is as follows:
|
postgresql_%a_%H.log | Selecting this value will keep logs for 7 days. |
postgresql_%d_%H.log | Selecting this value allows logs to be retained for 30 days, which is the system default. |
Was this page helpful?