[pgpool-hackers: 3790] Re: Proposal: Add log_disconnections parameter
Takuma Hoshiai
hoshiai.takuma at nttcom.co.jp
Mon Aug 24 11:14:11 JST 2020
Hi Ishii-san,
Thank you for your comments.I committed this patch.
On 2020/08/20 15:52, Tatsuo Ishii wrote:
> Hi Hoshiai-san,
>
> The patch looks good to me!
>
>> Hi,
>>
>> On 2020/08/18 17:31, Tatsuo Ishii wrote:
>>>> Hi Ishii-san,
>>>>
>>>> I have fixed a previous proposal patch about log_disconnections
>>>> paramter. A session time is added in log message.
>>>>
>>>> A previous mail is:
>>>> [pgpool-hackers: 3656] Re: Proposal: Add log_disconnections parameter
>>>>
>>>>
>>>> e.g.
>>>> enable log_connections and log_disconnections, and execute the
>>>> following query
>>>> psql -p 11000 test -c "SELECT pg_sleep(5)"
>>>>
>>>> == log messages ======
>>>> 2020-08-13 18:04:39: child pid 10830: LOG: new connection received
>>>> 2020-08-13 18:04:39: child pid 10830: DETAIL: connecting host=[local]
>>>> 2020-08-13 18:04:39: psql pid 10830: LOG: pool_reuse_block: blockid: 0
>>>> 2020-08-13 18:04:39: psql pid 10830: CONTEXT: while searching system
>>>> catalog, When relcache is missed
>>>> 2020-08-13 18:04:44: psql pid 10830: LOG: frontend connection closed
>>>> 2020-08-13 18:04:44: psql pid 10830: DETAIL: connected host=[local]
>>>> session time: 0:00:05.037
>>>> =====================
>>> Isn't it better the message format of log_disconnections matches with
>>> PostgreSQL's message? It's something like:
>>> ereport(LOG,
>>> (errmsg("disconnection: session time: %d:%02d:%02d.%03d "
>>> "user=%s database=%s host=%s%s%s",
>>> hours, minutes, seconds, msecs,
>>> port->user_name, port->database_name, port->remote_host,
>>> port->remote_port[0] ? " port=" : "", port->remote_port)));
>>> (in log_disconnections() of src/backend/tcop/postgres.c)
>>
>> Thank you for your advice.I think so, too.
>> I reflected it to my patch.
>>
>> $ psql -p 11000 test -c "SELECT pg_sleep(3);"
>> 2020-08-20 14:16:30: psql pid 4108:LOG: new connection received
>> 2020-08-20 14:16:30: psql pid 4108:DETAIL: connecting host=[local]
>> 2020-08-20 14:16:33: psql pid 4108:LOG: frontend disconnection:
>> session time: 0:00:03.007 user=hoshiai database=test host=[local]
>>
>>
>>> Best regards,
>>> --
>>> Tatsuo Ishii
>>> SRA OSS, Inc. Japan
>>> English: http://www.sraoss.co.jp/index_en.php
>>> Japanese:http://www.sraoss.co.jp
>>>
>>
>> Best Regards,
>> --
>> Takuma Hoshiai <hoshiai.takuma at nttcom.co.jp>
Best Regards,
--
Takuma Hoshiai <hoshiai.takuma at nttcom.co.jp>
More information about the pgpool-hackers
mailing list