Re: [Proposal] Adding Log File Capability to pg_createsubscriber

Amit Kapila <amit.kapila16@gmail.com>

From: Amit Kapila <amit.kapila16@gmail.com>
To: shveta malik <shveta.malik@gmail.com>
Cc: Gyan Sreejith <gyan.sreejith@gmail.com>, vignesh C <vignesh21@gmail.com>, Euler Taveira <euler@eulerto.com>, "kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, Peter Smith <smithpb2250@gmail.com>
Date: 2026-03-17T10:40:53Z
Lists: pgsql-hackers
On Tue, Mar 17, 2026 at 11:36 AM shveta malik <shveta.malik@gmail.com> wrote:
>
> 1)
>  I observed that when we give both --verbose and --logdir options, it
> skips verbose and only dumps logs to logdir. Is this intentional?
>
> I don't see any other postgres command with both the options provided
> and thus cannot compare the behaviour. But IMO, if the user has
> explicitly given both options, we should dump the log on both (stdout
> and logfile).
>

The entire log should be dumped in the specified log_file. I think
this is similar to one setting server's log_level to debug1 and then
start server with -l option in which case the entire log is dumped to
server log file.

-- 
With Regards,
Amit Kapila.



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. pg_createsubscriber: Don't use MAXPGPATH

  2. pg_createsubscriber: Remove separate logfile_open() function

  3. pg_createsubscriber: Use logging.c log file callback

  4. Add log file support to logging.c

  5. pg_createsubscriber: Add -l/--logdir option to redirect output to files.

  6. pg_createsubscriber: Introduce module-specific logging functions.

  7. Fix another buglet in archive_waldump.c.