{"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"}],"derived_content_hash":"b89e2c89f1c0287e92bf61460339dc7f37d3f2dc53d329aefe52b4e22954384b","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:e0f2fd18bac48774afbe08b4ccde58e2b83063703e76ae43dd8d125c83081dc6","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"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"],"repair_provenance":{"original_source_revision":"english-manuals:88e3629cd057b51457df5bc043b49baeb9e8a8e84fc3e7363373721d6b2b2430","receipt_sha256":"8349710adc28138b905892dfc53366159dbed5a1de0ddb7dbb1153633a377910","repair":"wiki-repair-20261023"},"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":"wiki-repair-20261023:e0f2fd18bac48774afbe08b4ccde58e2b83063703e76ae43dd8d125c83081dc6","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"log_rotation_age","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"log_rotation_age","SourceRevision":"wiki-repair-20261023:e0f2fd18bac48774afbe08b4ccde58e2b83063703e76ae43dd8d125c83081dc6","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.","description_zh":"当 logging_collector 被启用时，这个参数决定单个日志文件使用的最长时间，超过后创建一个新的日志文件。如果指定值时没有单位，则以分钟为单位。默认为 24 小时。将这个参数设置为零将禁用基于时间的新日志文件创建。这个参数只能在 postgresql.conf 文件中或在服务器命令行上设置。","description_zh_html":"\u003cp\u003e\n        当 \u003ccode class=\"varname\"\u003elogging_collector\u003c/code\u003e 被启用时，这个参数决定单个日志文件使用的最长时间，超过后创建一个新的日志文件。如果指定值时没有单位，则以分钟为单位。默认为 24 小时。将这个参数设置为零将禁用基于时间的新日志文件创建。这个参数只能在 \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e 文件中或在服务器命令行上设置。\n       \u003c/p\u003e","doc":{"anchor":"GUC-LOG-ROTATION-AGE","file":"runtime-config-logging.html","lang":"en","sha256":"278d913b9c0f735c5cd7b35fd7205826bbd9c449805370d2dbe54105c0ed1d88","slug":"18"},"doc_html":"\u003cp\u003e\n        When \u003ccode class=\"varname\"\u003elogging_collector\u003c/code\u003e is enabled,\n        this parameter determines the maximum amount of time to use an\n        individual log file, after which a new log file will be created.\n        If this value is specified without units, it is taken as minutes.\n        The default is 24 hours.\n        Set to zero to disable time-based creation of new log files.\n        This parameter can only be set in the \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e\n        file or on the server command line.\n       \u003c/p\u003e","doc_same_as":"","documentation_revision":{"inputs":[{"file":"runtime-config-logging.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"278d913b9c0f735c5cd7b35fd7205826bbd9c449805370d2dbe54105c0ed1d88","version":"18.7"},{"file":"runtime-config-logging.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"68c010254e1859ec0b76f06a563babd51a6c38997f1242e35e4c6b649724b1cb","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"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","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-logging.html","sha256":"a322f5293f10e348b5fc5dca98fdb6af52462723a215b8701c3b9d933e2933b4"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":"min","vartype":"integer","zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"GUC-LOG-ROTATION-AGE","file":"runtime-config-logging.html","lang":"en","sha256":"278d913b9c0f735c5cd7b35fd7205826bbd9c449805370d2dbe54105c0ed1d88","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\u003e\n        When \u003ccode\u003elogging_collector\u003c/code\u003e is enabled,\n        this parameter determines the maximum amount of time to use an\n        individual log file, after which a new log file will be created.\n        If this value is specified without units, it is taken as minutes.\n        The default is 24 hours.\n        Set to zero to disable time-based creation of new log files.\n        This parameter can only be set in the \u003ccode\u003epostgresql.conf\u003c/code\u003e\n        file or on the server command line.\n       \u003c/p\u003e","SourceRevision":"wiki-repair-20261023:e0f2fd18bac48774afbe08b4ccde58e2b83063703e76ae43dd8d125c83081dc6","ContentHash":"adfada2721756062c59953992ab9a751607fbf9d70b289a78a1c68c50b84562d","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":"en","Fallback":false,"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","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
