[Pgpool-general] logging the client IP address/hostname

Lonni J Friedman netllama at gmail.com
Mon Nov 7 02:06:28 UTC 2011


On Sun, Nov 6, 2011 at 5:58 PM, Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
>> Greetings,
>> I'm using pgpool-3.0.4 to load balance queries between 3 PostgreSQL
>> servers.  I'm occasionally seeing some "unable to parse the query'
>> errors in the pgpool log for queries that are malformed from a client.
>>  The problem is that pgpool doesn't log the client IP or hostname, so
>> its rather difficult to debug.  Other than enabling full debug logs
>> for pgpool, is there some way to add the client IP address (or
>> hostname) whenever pgpool creates a log entry?
>
> By enabling "log_connections" you have your client IP and pgpool child
> pid in your log. Since the log for "unable parse..." includes pgpool
> child pid, you can get client IP by checking pgpool child pid.
>
> LOG:   pid 4327: connection received: host=[local]
> LOG:   pid 4327: SimpleQuery: Unable to parse the query: select select;

I was hoping there was some way other than enabling log_connections,
as that's going to log every single connection (millions/day), even if
there's no error?


More information about the Pgpool-general mailing list