{"Entry":{"collection":"guc","key":"log_rotation_size","name":"log_rotation_size","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 kilobytes.","to":"Sets the maximum size a log file can reach before being rotated."}},"from":"14","status":"changed","to":"15"},{"documentation_changed":false,"fields":{"extra_desc":{"from":null,"to":"0 disables size-based creation of new log files."},"max_val":{"from":"2097151","to":"2147483647"}},"from":"17","status":"changed","to":"18"}],"content_hash":"fe720803cd438a4edb46d5f6d2e1e7c7a71741fe54e7d4f6ec8793ad9cbdd080","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"10 MiB"}],"editorial":{"advice":{"olap":"Analytical bursts can cross a size threshold repeatedly; test the resulting filename suffixes, shipping throughput, and maximum single-file size rather than choosing a larger number by habit.","oltp":"Use a nonzero log_rotation_size when file size itself must be bounded, and coordinate it with a filename that cannot collide during multiple rotations in one time period. If set to zero, verify that time-based rotation and disk alerts provide the bound instead.","small":"A modest size cap limits damage from a logging spike, but too-small files increase metadata and shipping overhead. Zero is acceptable only with a proven time-based cycle and free-space guardrail."},"mechanism":["log_rotation_size sets the maximum size a log file can reach before being rotated. 0 disables size-based creation of new log files. The collector rotates when the current file reaches approximately this size; zero disables the size trigger but not time-based rotation.","log_rotation_size 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_size 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.","Setting zero without a working time-based or external rotation policy and allowing unbounded growth."],"references":[{"title":"PostgreSQL 19 Beta 4: log_rotation_size","url":"https://www.postgresql.org/docs/19/runtime-config-logging.html#GUC-LOG-ROTATION-SIZE"},{"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_age"],"summary":"log_rotation_size is the PostgreSQL setting that defines the maximum size a log file can reach before being rotated."},"enumvals":[],"first_version":"8.0","group":"Reporting and Logging","group_slug":"logging","imported_at":"2026-09-30T00:40:57.414578+08:00","intro_commit":{},"key":"log_rotation_size","last_version":"20","max_val":"","min_val":"","name":"log_rotation_size","position":245,"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 size of an individual log file.","short_desc_zh":"","source_rev":"english-manuals:316dcb08f196ee077fd73884fc4194e506d3a56051a2a6738e092208e6ad253e","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"log_rotation_size","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"log_rotation_size","SourceRevision":"english-manuals:316dcb08f196ee077fd73884fc4194e506d3a56051a2a6738e092208e6ad253e","Facts":{"boot_val":"10240","category":"Reporting and Logging / Where to Log","context":"sighup","description":"When logging_collector is enabled, this parameter determines the maximum size of an individual log file. After this amount of data has been emitted into a log file, a new log file will be created. If this value is specified without units, it is taken as kilobytes. The default is 10 megabytes. Set to zero to disable size-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-SIZE","file":"runtime-config-logging.html","lang":"en","sha256":"93c48c522a72fca19705c4c91a71e951eae653662008eee2e4a9a74a11127fde","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"0 disables size-based creation of new log files.","lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"0","name":"log_rotation_size","short_desc":"Sets the maximum size a log file can reach before being rotated.","source":"pg-settings-source-snapshot","unit":"kB","vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-LOG-ROTATION-SIZE","file":"runtime-config-logging.html","lang":"en","sha256":"93c48c522a72fca19705c4c91a71e951eae653662008eee2e4a9a74a11127fde","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"log_rotation_size","SourceDatabase":"center","Version":"18","Locale":"en","Title":"log_rotation_size","Summary":"When logging_collector is enabled, this parameter determines the maximum size of an individual log file. After this amount of data has been emitted into a log file, a new log file will be created. If this value is specified without units, it is taken as kilobytes. The default is 10 megabytes. Set to zero to disable size-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 size of an individual log file. After this amount of data has been emitted into a log file, a new log file will be created. If this value is specified without units, it is taken as kilobytes. The default is 10 megabytes. Set to zero to disable size-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:316dcb08f196ee077fd73884fc4194e506d3a56051a2a6738e092208e6ad253e","ContentHash":"aebb282065ed386558c454a8e79ef64bd4701e1a14bf18903aea29f4e9c280c7","Payload":{"description":"When logging_collector is enabled, this parameter determines the maximum size of an individual log file. After this amount of data has been emitted into a log file, a new log file will be created. If this value is specified without units, it is taken as kilobytes. The default is 10 megabytes. Set to zero to disable size-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}
