{"Entry":{"collection":"guc","key":"log_timezone","name":"log_timezone","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Reporting and Logging / What to Log","category_zh":"","changed_in":["9.1","9.2"],"changes":[{"documentation_changed":false,"fields":{},"from":"8.2","status":"added","to":"8.3"},{"documentation_changed":true,"fields":{},"from":"8.4","status":"changed","to":"9.0"},{"documentation_changed":true,"fields":{"boot_val":{"from":"UNKNOWN","to":null}},"from":"9.0","status":"changed","to":"9.1"},{"documentation_changed":true,"fields":{"boot_val":{"from":null,"to":"GMT"}},"from":"9.1","status":"changed","to":"9.2"}],"content_hash":"37d57379ccd949be8479b6136c8cf0e6af72deec6518e325850d1424230385cb","context":"","default_changed_in":["9.1","9.2"],"default_history":[{"from":"9.0","to":"9.0","value":"UNKNOWN"},{"from":"9.1","to":"9.1","value":"Not specified"},{"from":"9.2","to":"19","value":"GMT"}],"editorial":{"advice":{"olap":"Analytical workload type does not justify a separate log timezone. Keep UTC or the fleet standard and convert to local civil time only in reporting tools, especially across DST transitions.","oltp":"Use one cluster-wide timezone, normally UTC, so every session's server-log timestamps correlate across hosts, replicas, failovers, and centralized ingestion. Test parsers and log_filename expansion before changing it.","small":"Keep UTC unless an existing operational pipeline requires another stable zone. Changing log_timezone does not reduce log volume; it changes timestamp interpretation and potentially rotated filenames."},"mechanism":["log_timezone sets the time zone to use in log messages. It affects timestamps rendered by the logging system, including filename expansion context, but does not change session TimeZone or stored timestamps.","log_timezone 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.","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":["Editing log_timezone without reloading configuration and verifying the effective value and subsequent behavior.","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_timezone globally without a rollback plan and a client or operational compatibility test."],"references":[{"title":"PostgreSQL 19 Beta 4: log_timezone","url":"https://www.postgresql.org/docs/19/runtime-config-logging.html#GUC-LOG-TIMEZONE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["DateStyle","IntervalStyle","TimeZone","lc_time","timezone_abbreviations"],"summary":"log_timezone is the PostgreSQL setting that defines the time zone to use in log messages."},"enumvals":[],"first_version":"8.3","group":"Reporting and Logging","group_slug":"logging","imported_at":"2026-09-30T00:40:57.442491+08:00","intro_commit":{},"key":"log_timezone","last_version":"20","max_val":"","min_val":"","name":"log_timezone","position":254,"present_in":["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":"Sets the time zone used for timestamps written in the server log.","short_desc_zh":"","source_rev":"english-manuals:e16e956acd5bddd6888a77b333967f71531b352a1bed4fed2e9e43e828f8d815","unit":"","vartype":"string"}},"Definition":{"Collection":"guc","Key":"log_timezone","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"log_timezone","SourceRevision":"english-manuals:e16e956acd5bddd6888a77b333967f71531b352a1bed4fed2e9e43e828f8d815","Facts":{"boot_val":"GMT","category":"Reporting and Logging / What to Log","context":"sighup","description":"Sets the time zone used for timestamps written in the server log. Unlike TimeZone, this value is cluster-wide, so that all sessions will report timestamps consistently. The built-in default is GMT, but that is typically overridden in postgresql.conf; initdb will install a setting there corresponding to its system environment. See Section 8.5.3 for more information. This parameter can only be set in the postgresql.conf file or on the server command line.","doc":{"anchor":"GUC-LOG-TIMEZONE","file":"runtime-config-logging.html","lang":"en","sha256":"93c48c522a72fca19705c4c91a71e951eae653662008eee2e4a9a74a11127fde","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"log_timezone","short_desc":"Sets the time zone to use in log messages.","source":"pg-settings-source-snapshot","unit":null,"vartype":"string"},"ManualEvidence":{"doc":{"anchor":"GUC-LOG-TIMEZONE","file":"runtime-config-logging.html","lang":"en","sha256":"93c48c522a72fca19705c4c91a71e951eae653662008eee2e4a9a74a11127fde","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"log_timezone","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"log_timezone","Summary":"","BodyHTML":"\u003cp\u003e设置在服务器日志中写入的时间戳的时区。和\u003ca href=\"/docs/18/runtime-config-client.html#GUC-TIMEZONE\" rel=\"nofollow\"\u003eTimeZone\u003c/a\u003e不同，这个值是集簇范围的，因此所有会话将报告一致的时间戳。内置默认值是\u003ccode\u003eGMT\u003c/code\u003e，但是通常会被在\u003ccode\u003epostgresql.conf\u003c/code\u003e中覆盖。\u003cspan\u003einitdb\u003c/span\u003e将安装一个对应于其系统环境的设置。详见\u003ca href=\"/docs/18/datatype-datetime.html#DATATYPE-TIMEZONES\" rel=\"nofollow\"\u003e第 8.5.3 节\u003c/a\u003e。这个参数只能在\u003ccode\u003epostgresql.conf\u003c/code\u003e文件中或在服务器命令行上设置。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"e1abebd2976497dda1fdb011ba2a2c58f5a155d73783e343ce19fe3c35af0222","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e设置在服务器日志中写入的时间戳的时区。和\u003ca href=\"/docs/18/runtime-config-client.html#GUC-TIMEZONE\"\u003eTimeZone\u003c/a\u003e不同，这个值是集簇范围的，因此所有会话将报告一致的时间戳。内置默认值是\u003ccode class=\"literal\"\u003eGMT\u003c/code\u003e，但是通常会被在\u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e中覆盖。\u003cspan class=\"application\"\u003einitdb\u003c/span\u003e将安装一个对应于其系统环境的设置。详见\u003ca href=\"/docs/18/datatype-datetime.html#DATATYPE-TIMEZONES\" title=\"8.5.3. 时区\"\u003e第 8.5.3 节\u003c/a\u003e。这个参数只能在\u003ccode class=\"filename\"\u003epostgresql.conf\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","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}
