{"Entry":{"collection":"guc","key":"log_hostname","name":"log_hostname","aliases":[],"metadata":{"baseline":true,"boot_human":"Not specified","boot_val":null,"category":"Reporting and Logging / What to Log","category_zh":"","changed_in":[],"changes":[{"documentation_changed":true,"fields":{},"from":"7.4","status":"changed","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.4","status":"changed","to":"9.0"}],"content_hash":"15d4776f7e5bb4a38fb2bda8fc0f4e30e506a1e2883042fad9e030da5a446c73","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"off"}],"editorial":{"advice":{"olap":"Analytical jobs can justify richer log_hostname telemetry, but account for long statements, large bind values, and bursty completion patterns in the log pipeline.","oltp":"Tune log_hostname 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_hostname useful but bounded: verify disk, collector, retention, and redaction capacity before increasing detail or frequency."},"mechanism":["log_hostname logs the host name in the connection logs. By default, connection logs only show the IP address of the connecting host. If you want them to show the host name you can turn this on, but depending on your host name resolution setup it might impose a non-negligible performance penalty. Reverse DNS is performed to turn client addresses into names, which can add connection latency or stalls when name service is slow.","log_hostname 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_hostname 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.","Turning on reverse DNS where resolver latency lies on the connection path."],"references":[{"title":"PostgreSQL 19 Beta 4: log_hostname","url":"https://www.postgresql.org/docs/19/runtime-config-logging.html#GUC-LOG-HOSTNAME"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["application_name","cluster_name","update_process_title","log_line_prefix","log_timezone"],"summary":"log_hostname is the PostgreSQL setting that controls whether PostgreSQL logs the host name in the connection logs."},"enumvals":[],"first_version":"7.4","group":"Reporting and Logging","group_slug":"logging","imported_at":"2026-09-30T00:40:57.341046+08:00","intro_commit":{},"key":"log_hostname","last_version":"20","max_val":"","min_val":"","name":"log_hostname","position":229,"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":"By default, connection log messages only show the IP address of the connecting host.","short_desc_zh":"","source_rev":"english-manuals:5548f74179457f5acf3a5c459ff3780acc513a0c1762f0d91e343ae6a346c954","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"log_hostname","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"log_hostname","SourceRevision":"english-manuals:5548f74179457f5acf3a5c459ff3780acc513a0c1762f0d91e343ae6a346c954","Facts":{"boot_val":"off","category":"Reporting and Logging / What to Log","context":"sighup","description":"By default, connection log messages only show the IP address of the connecting host. Turning this parameter on causes logging of the host name as well. Note that depending on your host name resolution setup this might impose a non-negligible performance penalty. This parameter can only be set in the postgresql.conf file or on the server command line.","doc":{"anchor":"GUC-LOG-HOSTNAME","file":"runtime-config-logging.html","lang":"en","sha256":"93c48c522a72fca19705c4c91a71e951eae653662008eee2e4a9a74a11127fde","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"By default, connection logs only show the IP address of the connecting host. If you want them to show the host name you can turn this on, but depending on your host name resolution setup it might impose a non-negligible performance penalty.","lang":"en","max_val":null,"metadata_version":"18","min_val":null,"name":"log_hostname","short_desc":"Logs the host name in the connection logs.","source":"pg-settings-source-snapshot","unit":null,"vartype":"bool"},"ManualEvidence":{"doc":{"anchor":"GUC-LOG-HOSTNAME","file":"runtime-config-logging.html","lang":"en","sha256":"93c48c522a72fca19705c4c91a71e951eae653662008eee2e4a9a74a11127fde","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"log_hostname","SourceDatabase":"center","Version":"18","Locale":"en","Title":"log_hostname","Summary":"By default, connection log messages only show the IP address of the connecting host. Turning this parameter on causes logging of the host name as well. Note that depending on your host name resolution setup this might impose a non-negligible performance penalty. This parameter can only be set in the postgresql.conf file or on the server command line.","BodyHTML":"\u003cp\u003eBy default, connection log messages only show the IP address of the connecting host. Turning this parameter on causes logging of the host name as well. Note that depending on your host name resolution setup this might impose a non-negligible performance penalty. This parameter can only be set in the postgresql.conf file or on the server command line.\u003c/p\u003e","SourceRevision":"english-manuals:5548f74179457f5acf3a5c459ff3780acc513a0c1762f0d91e343ae6a346c954","ContentHash":"02a058c138afc8e43dcf1cd788499868b3f0a9b60733863428072076de12585a","Payload":{"description":"By default, connection log messages only show the IP address of the connecting host. Turning this parameter on causes logging of the host name as well. Note that depending on your host name resolution setup this might impose a non-negligible performance penalty. 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","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"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
