public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrian Klaver <[email protected]>
To: Tefft, Michael J <[email protected]>
To: [email protected] <[email protected]>
Subject: Re: Capturing both IP address and hostname in the log
Date: Thu, 10 Apr 2025 08:22:56 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <BN8PR04MB550874EE58EC715656C3D3D2D0B72@BN8PR04MB5508.namprd04.prod.outlook.com>
References: <BN8PR04MB550874EE58EC715656C3D3D2D0B72@BN8PR04MB5508.namprd04.prod.outlook.com>

On 4/10/25 05:22, Tefft, Michael J wrote:
> The documentation for log_hostname says:
> 
> log_hostname (boolean)
> 
> 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.
> 
> https://www.postgresql.org/docs/14/runtime-config-logging.html 
> <https://www.postgresql.org/docs/14/runtime-config-logging.html;
> 
> We have set log_hostname ON and we get hostname reported – but we do not 
> get IP address. We would like to capture both.
> 
> Since the doc says “Turning this parameter on causes logging of the host 
> name **as well**” we were hoping we would capture both, but we are not 
> getting what we expect.
> 
> Is there a way to capture both IP address and hostname in the log 
> messages? Or must we choose “one or the ootehr”?

I see the same thing. It seems either or.

> 
> Thanks,
> 
> Mike Tefft
> 
> (We are using PG14 and PG16, but the docs say the same thing, as does PG17)
> 

-- 
Adrian Klaver
[email protected]







view thread (6+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Capturing both IP address and hostname in the log
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox