[pgpool-hackers: 3785] Re: Proposal: Add log_disconnections parameter
Tatsuo Ishii
ishii at sraoss.co.jp
Tue Aug 18 17:31:03 JST 2020
> 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)
Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp
More information about the pgpool-hackers
mailing list