{"Entry":{"collection":"guc","key":"log_min_messages","name":"log_min_messages","aliases":[],"metadata":{"baseline":true,"boot_human":"Not specified","boot_val":null,"category":"Reporting and Logging / When to Log","category_zh":"","changed_in":["19"],"changes":[{"documentation_changed":true,"fields":{},"from":"7.4","status":"changed","to":"8.0"},{"documentation_changed":true,"fields":{},"from":"8.3","status":"changed","to":"8.4"},{"documentation_changed":true,"fields":{},"from":"14","status":"changed","to":"15"},{"documentation_changed":true,"fields":{"enumvals":{"from":["debug5","debug4","debug3","debug2","debug1","info","notice","warning","error","log","fatal","panic"],"to":null},"vartype":{"from":"enum","to":"string"}},"from":"18","status":"changed","to":"19"},{"documentation_changed":true,"fields":{},"from":"19","status":"changed","to":"20"}],"content_hash":"b475054c109efe1700e1c610095cecc914e12732a00fdf978ffd80f5f12602ec","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"warning"}],"editorial":{"advice":{"olap":"Analytical jobs can justify richer log_min_messages telemetry, but account for long statements, large bind values, and bursty completion patterns in the log pipeline.","oltp":"Tune log_min_messages against an explicit observability question and a measured log-volume budget. Prefer selective thresholds, sampling, or role-level overrides over indiscriminate capture.","small":"Keep log_min_messages useful but bounded: verify disk, collector, retention, and redaction capacity before increasing detail or frequency."},"mechanism":["log_min_messages sets the message levels that are logged. Each level includes all the levels that follow it. The later the level, the fewer messages are sent. The server-log severity ordering has special placement for LOG and differs from client_min_messages, so a threshold name cannot be copied blindly between them.","log_min_messages is a SUPERUSER-context setting. Superuser or a role granted the appropriate SET privilege can change it for a session, while ALTER ROLE or ALTER DATABASE can establish a default for future sessions.","It changes emitted diagnostic data rather than query semantics, but volume, sensitive content, log_line_prefix, destinations, collector throughput, and retention determine operational cost and usefulness."],"pitfalls":["Changing log_min_messages in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.","Enabling richer logging without budgeting collector throughput, storage, retention, and downstream query cost.","Writing SQL text, bind values, identities, or host data without a redaction and access-control policy.","Changing log_min_messages globally without a rollback plan and a client or operational compatibility test."],"references":[{"title":"PostgreSQL 19 Beta 4: log_min_messages","url":"https://www.postgresql.org/docs/19/runtime-config-logging.html#GUC-LOG-MIN-MESSAGES"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["log_min_error_statement","log_min_duration_statement","log_min_duration_sample","log_statement_sample_rate","log_transaction_sample_rate"],"summary":"log_min_messages is the PostgreSQL setting that defines the message levels that are logged."},"enumvals":[],"first_version":"7.4","group":"Reporting and Logging","group_slug":"logging","imported_at":"2026-09-30T00:40:57.385903+08:00","intro_commit":{},"key":"log_min_messages","last_version":"20","max_val":"","min_val":"","name":"log_min_messages","position":236,"present_in":["7.4","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":"Controls which message levels are written to the server log.","short_desc_zh":"","source_rev":"english-manuals:9bb0a6a8fc69849aef41deb59adbf215f9ace2e85df937b68ee7f69b47ce03bd","unit":"","vartype":"string"}},"Definition":{"Collection":"guc","Key":"log_min_messages","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"log_min_messages","SourceRevision":"english-manuals:9bb0a6a8fc69849aef41deb59adbf215f9ace2e85df937b68ee7f69b47ce03bd","Facts":{"boot_val":"warning","category":"Reporting and Logging / When to Log","context":"superuser","description":"Controls which message levels are written to the server log. Valid values are DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1, INFO, NOTICE, WARNING, ERROR, LOG, FATAL, and PANIC. Each level includes all the levels that follow it. The later the level, the fewer messages are sent to the log. The default is WARNING. Note that LOG has a different rank here than in client_min_messages. Only superusers and users with the appropriate SET privilege can change this setting.","doc":{"anchor":"GUC-LOG-MIN-MESSAGES","file":"runtime-config-logging.html","lang":"en","sha256":"93c48c522a72fca19705c4c91a71e951eae653662008eee2e4a9a74a11127fde","slug":"18"},"documented":true,"enumvals":["debug5","debug4","debug3","debug2","debug1","info","notice","warning","error","log","fatal","panic"],"extra_desc":"Each level includes all the levels that follow it. The later the level, the fewer messages are sent.","lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"log_min_messages","short_desc":"Sets the message levels that are logged.","source":"pg-settings-source-snapshot","unit":null,"vartype":"enum"},"ManualEvidence":{"doc":{"anchor":"GUC-LOG-MIN-MESSAGES","file":"runtime-config-logging.html","lang":"en","sha256":"93c48c522a72fca19705c4c91a71e951eae653662008eee2e4a9a74a11127fde","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"log_min_messages","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"log_min_messages","Summary":"","BodyHTML":"\u003cp\u003e控制将哪些\u003ca href=\"/docs/18/runtime-config-logging.html#RUNTIME-CONFIG-SEVERITY-LEVELS\" rel=\"nofollow\"\u003e消息级别\u003c/a\u003e写入服务器日志。有效值为\u003ccode\u003eDEBUG5\u003c/code\u003e，\u003ccode\u003eDEBUG4\u003c/code\u003e，\u003ccode\u003eDEBUG3\u003c/code\u003e，\u003ccode\u003eDEBUG2\u003c/code\u003e，\u003ccode\u003eDEBUG1\u003c/code\u003e，\u003ccode\u003eINFO\u003c/code\u003e，\u003ccode\u003eNOTICE\u003c/code\u003e，\u003ccode\u003eWARNING\u003c/code\u003e，\u003ccode\u003eERROR\u003c/code\u003e，\u003ccode\u003eLOG\u003c/code\u003e，\u003ccode\u003eFATAL\u003c/code\u003e和 \u003ccode\u003ePANIC\u003c/code\u003e。每个级别包括其后的所有级别。级别越高，发送到日志的消息越少。默认值为\u003ccode\u003eWARNING\u003c/code\u003e。请注意，在\u003ca href=\"/docs/18/runtime-config-client.html#GUC-CLIENT-MIN-MESSAGES\" rel=\"nofollow\"\u003eclient_min_messages\u003c/a\u003e中，\u003ccode\u003eLOG\u003c/code\u003e的排名不同。只有超级用户和具有适当\u003ccode\u003eSET\u003c/code\u003e权限的用户才能更改此设置。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"77bed866fee8cec8d230ba403289e84030d299b5c849a785c918f923bfa3402a","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e控制将哪些\u003ca href=\"/docs/18/runtime-config-logging.html#RUNTIME-CONFIG-SEVERITY-LEVELS\" title=\"表 19.2. 消息严重级别\"\u003e消息级别\u003c/a\u003e写入服务器日志。有效值为\u003ccode class=\"literal\"\u003eDEBUG5\u003c/code\u003e，\u003ccode class=\"literal\"\u003eDEBUG4\u003c/code\u003e，\u003ccode class=\"literal\"\u003eDEBUG3\u003c/code\u003e，\u003ccode class=\"literal\"\u003eDEBUG2\u003c/code\u003e，\u003ccode class=\"literal\"\u003eDEBUG1\u003c/code\u003e，\u003ccode class=\"literal\"\u003eINFO\u003c/code\u003e，\u003ccode class=\"literal\"\u003eNOTICE\u003c/code\u003e，\u003ccode class=\"literal\"\u003eWARNING\u003c/code\u003e，\u003ccode class=\"literal\"\u003eERROR\u003c/code\u003e，\u003ccode class=\"literal\"\u003eLOG\u003c/code\u003e，\u003ccode class=\"literal\"\u003eFATAL\u003c/code\u003e和 \u003ccode class=\"literal\"\u003ePANIC\u003c/code\u003e。每个级别包括其后的所有级别。级别越高，发送到日志的消息越少。默认值为\u003ccode class=\"literal\"\u003eWARNING\u003c/code\u003e。请注意，在\u003ca href=\"/docs/18/runtime-config-client.html#GUC-CLIENT-MIN-MESSAGES\"\u003eclient_min_messages\u003c/a\u003e中，\u003ccode class=\"literal\"\u003eLOG\u003c/code\u003e的排名不同。只有超级用户和具有适当\u003ccode class=\"literal\"\u003eSET\u003c/code\u003e权限的用户才能更改此设置。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","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}
