RE: libpq debug log - Mailing list pgsql-hackers

From Nagaura, Ryohei
Subject RE: libpq debug log
Date
Msg-id EDA4195584F5064680D8130B1CA91C453BF258@G01JPEXMBYT04
Whole thread Raw
In response to RE: libpq debug log  ("Iwata, Aya" <iwata.aya@jp.fujitsu.com>)
Responses RE: libpq debug log
List pgsql-hackers
Hi Iwata-san,

I used your patch for my private work, so I write my opinion and four feedback below.
On Fri, Jan 18, 2019 at 8:19 AM, Iwata, Aya wrote:
> - Setting whether to get log or not by using connection strings or environment
> variables. It means that application source code changes is not needed to get
> the log.
> - Getting time when receive and send process start/end. Functions too.
This merit was very helpful for my use, so I want your proposal function in postgres.

The followings are feedback from me.

1)
It would be better making the log format the same as the server log format, I think.
Your log format:
    2019/01/22 04:15:25.496 ...
Server log format:
    2019-01-22 04:15:25.496 UTC ...
There are two differences:
    One is separator character of date, "/" and "-".
    The another is standard time information.

2)
It was difficult for me to understand the first line message in the log file.
"Max log size is 10B, log min level is LEVEL1"
Does this mean as follows?
"The maximum size of this file is 10 Bytes, the parameter 'log min level' is set to LEVEL 1."

3)
Under the circumstance that the environment variables "PGLOGDIR" and "PGLOGSIZE" are set correctly,
the log file will also be created when the user connect the server with "psql".
Does this follow the specification you have thought?
Is there any option to unset only in that session when you want to connect with "psql"?

4)
Your patch affects the behavior of PQtrace().
The log of the existing PQtrace() is as follows:
From backend> "id"
From backend (#4)> 16387
From backend (#2)> 1
From backend (#4)> 23
...
Your patch makes PQtrace() including the following log in addition to the above.
To backend> Msg complete, length 27
Start sending message to backend:End sending message to backend:PQsendQuery end :PQgetResult start :Start receiving
messagefrom backend:End receiving message from backend:From backend> T
 
...


For your information.
Best regards,
---------------------
Ryohei Nagaura



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Synchronous replay take III
Next
From: Corey Huinker
Date:
Subject: Re: \describe*