PostgreSQL
TMA-POSTGRES-3.1.9
Ensure the maximum log file size is set correctly
LowLevel 1Manual reviewpostgres
Description
The log_rotation_size setting determines the maximum size of an individual log file. Once the maximum size is reached, automatic log file rotation will occur.
How it is checked
Audit method: Manual review
This recommendation cannot be checked automatically. A scan lists it with these instructions when you pass --include-manual.
Run SHOW log_rotation_size; (default 0, size-based rotation disabled) and confirm the value matches your logging policy.
How it is fixed
Fix method: Guidance or infrastructure patch
ALTER SYSTEM SET log_rotation_size = '1GB'; (example) then SELECT pg_reload_conf();
Properties
- Operating systems
- Any
- Tags
- postgresdatabaseloggingmanual
- Reference
- CIS PostgreSQL 18 Benchmark v1.0.0 - 3.1.9 Ensure the maximum log file size is set correctly