RE: libpq debug log

From: "Iwata, Aya" <iwata(dot)aya(at)jp(dot)fujitsu(dot)com>
To: 'Tom Lane' <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "Jamison, Kirk" <k(dot)jamison(at)jp(dot)fujitsu(dot)com>, "Nagaura, Ryohei" <nagaura(dot)ryohei(at)jp(dot)fujitsu(dot)com>, Jacob Champion <pchampion(at)pivotal(dot)io>, "Jim Doty" <jdoty(at)pivotal(dot)io>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, "nagata(at)sraoss(dot)co(dot)jp" <nagata(at)sraoss(dot)co(dot)jp>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Subject: RE: libpq debug log
Date: 2019-03-04 08:13:00
Message-ID: 71E660EB361DF14299875B198D4CE5423DEF1844@g01jpexmbkw25
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Thank you for your comments and advice.

I'd like to consider your suggestions.
I am planning to change libpq logging like this;

1. Expand PQtrace() facility and improve libpq logging.

2. Prepare "output level". There are 3 type of levels;
- TRADITIONAL : if set, outputs protocol messages
- LEVEL1 : if set, outputs phase and time
- LEVEL2 : if set, outputs both info TRADITIONAL and LEVEL1

3. Add "output phase" information; This is the processing flow. (ex. When PQexec() start and end )

4. Change output method to callback style; Default is stdout, and prepare other callback functions that will be used more frequently.

5. Initialization method;
In current one: PQtrace(PGconn *conn, FILE *stream);
Proposed change: PQtraceEx(PGconn *conn, FILE *stream, PQloggingProcessor callback_func , void *callback_arg, PGLogminlevel level);
PQtrace() can be use as it is to consider compatibility with previous applications,
so I leave PQtrace() and created a new function PQtraceEx().

After discussing the abovementioned, then maybe we can discuss more about enabling trace output and changing the output style.

What do you think? I would appreciate your comments and suggestions.

Regards,
Aya Iwata

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Khandekar 2019-03-04 08:39:52 Re: Minimal logical decoding on standbys
Previous Message Rahila Syed 2019-03-04 07:57:29 Re: monitoring CREATE INDEX [CONCURRENTLY]