[pgpool-general: 836] Re: [Pgpool-general] logging the client IP address/hostname

Lonni J Friedman netllama at gmail.com
Wed Aug 1 06:43:25 JST 2012


On Tue, Jul 31, 2012 at 2:10 PM, Tatsuo Ishii <ishii at postgresql.org> wrote:
>> On Mon, Nov 21, 2011 at 3:59 PM, Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
>>>> On Sun, Nov 20, 2011 at 4:27 AM, Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
>>>>>>>> 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?
>>>>>>
>>>>>> Good suggestion. I would like to include it for next release (3.2)
>>>>>> unless someone beats me.
>>>>>
>>>>> Here is the patch I promised. Here are sample log entries.
>>>>>
>>>>> From TCP/IP client case:
>>>>> 2011-11-20 21:15:52 LOG:   pid 23045: SimpleQuery: Unable to parse the query: "select select;" from client 127.0.0.1(33737)
>>>>>
>>>>> From Unix domain socket client case:
>>>>> 2011-11-20 21:14:46 LOG:   pid 23045: SimpleQuery: Unable to parse the query: "select select;" from local client
>>>>
>>>> The sample log entries look good to me, thanks!
>>>
>>> Patch committed to master branch(to be 3.2).
>>
>> Is this functionality enabled by default in 3.2, or is it masked
>> behind a config option in pgool.conf ?  I don't see any obvious
>> options in the dox.
>
> This is enabled by default in 3.2.

ok, thanks for confirming.


More information about the pgpool-general mailing list