{"Entry":{"collection":"guc","key":"log_rotation_age","name":"log_rotation_age","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Reporting and Logging / Where to Log","category_zh":"","changed_in":["15","18"],"changes":[{"documentation_changed":false,"fields":{},"from":"7.4","status":"added","to":"8.0"},{"documentation_changed":true,"fields":{},"from":"8.0","status":"changed","to":"8.1"},{"documentation_changed":true,"fields":{},"from":"8.1","status":"changed","to":"8.2"},{"documentation_changed":true,"fields":{},"from":"8.2","status":"changed","to":"8.3"},{"documentation_changed":true,"fields":{},"from":"11","status":"changed","to":"12"},{"documentation_changed":false,"fields":{"short_desc":{"from":"Automatic log file rotation will occur after N minutes.","to":"Sets the amount of time to wait before forcing log file rotation."}},"from":"14","status":"changed","to":"15"},{"documentation_changed":false,"fields":{"extra_desc":{"from":null,"to":"0 disables time-based creation of new log files."}},"from":"17","status":"changed","to":"18"}],"content_hash":"1a38c55c26ec8b7550658f0847249eaafef366946b7cd2b1f9729971821c71e8","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"1 d"}],"editorial":{"advice":{"olap":"Long analytical bursts do not require a different clock by themselves; choose an interval that lets downstream systems close and ingest files predictably without producing impractically large objects.","oltp":"Set log_rotation_age from the maximum time a file may remain open and the shipping/retention boundary. Confirm that the filename pattern creates a distinct or intentionally reusable name at that interval.","small":"Prefer a simple daily or shorter interval that keeps failure blast radius bounded. Zero disables time rotation and is safe only when size-based or external rotation is authoritative and tested."},"mechanism":["log_rotation_age sets the amount of time to wait before forcing log file rotation. 0 disables time-based creation of new log files. The collector opens a new file after the interval; zero disables this trigger but leaves size-based or external rotation possible.","log_rotation_age is a SIGHUP-context setting: a configuration reload activates the new server value without a restart; subsequent operations that consult it use the refreshed value.","The active path is composed from log_destination, logging_collector or syslog/eventlog, file naming and permissions, rotation triggers, and external shipping or retention."],"pitfalls":["Editing log_rotation_age without reloading configuration and verifying the effective value and subsequent behavior.","Combining incompatible destination, collector, filename, and rotation assumptions and then losing or overwriting logs.","Failing to monitor a full or unwritable log target, which can block logging or database activity depending on the path.","Changing log_rotation_age globally without a rollback plan and a client or operational compatibility test."],"references":[{"title":"PostgreSQL 19 Beta 4: log_rotation_age","url":"https://www.postgresql.org/docs/19/runtime-config-logging.html#GUC-LOG-ROTATION-AGE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["logging_collector","log_destination","log_directory","log_filename","log_rotation_size"],"summary":"log_rotation_age is the PostgreSQL setting that defines the amount of time to wait before forcing log file rotation."},"enumvals":[],"first_version":"8.0","group":"Reporting and Logging","group_slug":"logging","imported_at":"2026-09-30T00:40:57.410407+08:00","intro_commit":{},"key":"log_rotation_age","last_version":"20","max_val":"","min_val":"","name":"log_rotation_age","position":244,"present_in":["8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"short_desc":"When logging_collector is enabled, this parameter determines the maximum amount of time to use an individual log file, after which a new log file will be created.","short_desc_zh":"","source_rev":"english-manuals:88e3629cd057b51457df5bc043b49baeb9e8a8e84fc3e7363373721d6b2b2430","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"log_rotation_age","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"log_rotation_age","SourceRevision":"english-manuals:88e3629cd057b51457df5bc043b49baeb9e8a8e84fc3e7363373721d6b2b2430","Facts":{"boot_val":"1440","category":"Reporting and Logging / Where to Log","context":"sighup","description":"When logging_collector is enabled, this parameter determines the maximum amount of time to use an individual log file, after which a new log file will be created. If this value is specified without units, it is taken as minutes. The default is 24 hours. Set to zero to disable time-based creation of new log files. This parameter can only be set in the postgresql.conf file or on the server command line.","doc":{"anchor":"GUC-LOG-ROTATION-AGE","file":"runtime-config-logging.html","lang":"en","sha256":"93c48c522a72fca19705c4c91a71e951eae653662008eee2e4a9a74a11127fde","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"0 disables time-based creation of new log files.","lang":"en","max_val":"35791394","metadata_version":"18","min_val":"0","name":"log_rotation_age","short_desc":"Sets the amount of time to wait before forcing log file rotation.","source":"pg-settings-source-snapshot","unit":"min","vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-LOG-ROTATION-AGE","file":"runtime-config-logging.html","lang":"en","sha256":"93c48c522a72fca19705c4c91a71e951eae653662008eee2e4a9a74a11127fde","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"log_rotation_age","SourceDatabase":"center","Version":"18","Locale":"en","Title":"log_rotation_age","Summary":"When logging_collector is enabled, this parameter determines the maximum amount of time to use an individual log file, after which a new log file will be created. If this value is specified without units, it is taken as minutes. The default is 24 hours. Set to zero to disable time-based creation of new log files. This parameter can only be set in the postgresql.conf file or on the server command line.","BodyHTML":"\u003cp\u003eWhen logging_collector is enabled, this parameter determines the maximum amount of time to use an individual log file, after which a new log file will be created. If this value is specified without units, it is taken as minutes. The default is 24 hours. Set to zero to disable time-based creation of new log files. This parameter can only be set in the postgresql.conf file or on the server command line.\u003c/p\u003e","SourceRevision":"english-manuals:88e3629cd057b51457df5bc043b49baeb9e8a8e84fc3e7363373721d6b2b2430","ContentHash":"dc87bfcb9bef98c43cc1464a2ecba3eec872602c64003c28e3702d71f785d1b2","Payload":{"description":"When logging_collector is enabled, this parameter determines the maximum amount of time to use an individual log file, after which a new log file will be created. If this value is specified without units, it is taken as minutes. The default is 24 hours. Set to zero to disable time-based creation of new log files. This parameter can only be set in the postgresql.conf file or on the server command line."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
