{"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"}],"derived_content_hash":"28c1cbdf463e621b2d33000323b313ecdbd8c23d75f69f8d6bcdfe6cb025a76b","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:df05c85ba73c72b62dadab506c44641cdc6c2e1ff498afbb65597bbce6b3fa89","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"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"],"repair_provenance":{"original_source_revision":"english-manuals:316dcb08f196ee077fd73884fc4194e506d3a56051a2a6738e092208e6ad253e","receipt_sha256":"af068777d5ee156ecfe764f90890b162fc360e3338816b0432ead456a9a1a770","repair":"wiki-repair-20261023"},"short_desc":"When logging_collector is enabled, this parameter determines the maximum size of an individual log file.","short_desc_zh":"","source_rev":"wiki-repair-20261023:df05c85ba73c72b62dadab506c44641cdc6c2e1ff498afbb65597bbce6b3fa89","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"log_rotation_size","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"log_rotation_size","SourceRevision":"wiki-repair-20261023:df05c85ba73c72b62dadab506c44641cdc6c2e1ff498afbb65597bbce6b3fa89","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.","description_zh":"当 logging_collector 被启用时，这个参数决定单个日志文件的最大尺寸。当发送到一个日志文件的数据量达到该值后，将创建一个新的日志文件。如果指定值的时候没有单位，则以千字节为单位。默认值是 10 兆字节。设置为零时将禁用基于大小创建新的日志文件。这个参数只能在 postgresql.conf 文件中或在服务器命令行上设置。","description_zh_html":"\u003cp\u003e\n        当 \u003ccode class=\"varname\"\u003elogging_collector\u003c/code\u003e 被启用时，这个参数决定单个日志文件的最大尺寸。当发送到一个日志文件的数据量达到该值后，将创建一个新的日志文件。如果指定值的时候没有单位，则以千字节为单位。默认值是 10 兆字节。设置为零时将禁用基于大小创建新的日志文件。这个参数只能在 \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e 文件中或在服务器命令行上设置。\n       \u003c/p\u003e","doc":{"anchor":"GUC-LOG-ROTATION-SIZE","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 size of an individual log file.\n        After this amount of data has been emitted into a log file,\n        a new log file will be created.\n        If this value is specified without units, it is taken as kilobytes.\n        The default is 10 megabytes.\n        Set to zero to disable size-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 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","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":"kB","vartype":"integer","zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"GUC-LOG-ROTATION-SIZE","file":"runtime-config-logging.html","lang":"en","sha256":"278d913b9c0f735c5cd7b35fd7205826bbd9c449805370d2dbe54105c0ed1d88","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\u003e\n        When \u003ccode\u003elogging_collector\u003c/code\u003e is enabled,\n        this parameter determines the maximum size of an individual log file.\n        After this amount of data has been emitted into a log file,\n        a new log file will be created.\n        If this value is specified without units, it is taken as kilobytes.\n        The default is 10 megabytes.\n        Set to zero to disable size-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:df05c85ba73c72b62dadab506c44641cdc6c2e1ff498afbb65597bbce6b3fa89","ContentHash":"d82d6589c8702c30297c3bf00a40978042a9e6b513872bb6af8ce50f6c07de91","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":"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}
