Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vTs2F-00Ci9o-0q for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Dec 2025 01:33:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vTs2E-006DTE-0f for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Dec 2025 01:33:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vTs2D-006DT5-2V for pgsql-hackers@lists.postgresql.org; Fri, 12 Dec 2025 01:33:30 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vTs2D-000EZf-02 for pgsql-hackers@lists.postgresql.org; Fri, 12 Dec 2025 01:33:29 +0000 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-37fcec29834so2086661fa.0 for ; Thu, 11 Dec 2025 17:33:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765503207; x=1766108007; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sZ1ILAEdvIJh9aI6hN6a9UFtRfjFY88WXK8M8nVybU0=; b=XFPKwchJLs5AceLeMui196hLjYvLGhGlZWTkkOHEPt7zpVcPt8YxHqh9Cstmsziff5 reqOL3p1J2WRD/mpMR13BvXZeVrlsGrtrw6uH/PH0uhH5UuMWeA664ryP9CKQo5PmyyT EGELY2oVT7PQ0EvtbHlFAWcQt74TqSTTDXFD5dPKq+DMe7wHt0CxROOFfaemBwgBoJVG YnJGmYEPS8n5x0WS+Tyahnkcyd8U2AQVV+tBJXMD2M4izU0XeC2PE+ArCCNL8jx5vA1f xh4gMn5nTpKG4DRx4mrN+1NTAWEsx7nlZQs2FipbIaSPbzze9y+2qChnPIgXm8JozzGH OFvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765503207; x=1766108007; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=sZ1ILAEdvIJh9aI6hN6a9UFtRfjFY88WXK8M8nVybU0=; b=fb1JJetFl8kVxrM+uFIHG30eyGpGGT5/Oot7e7d3Er/RFH4MSxnD3HwTreClix/LIW SH1WBsKOl56FcIePkOc808xJdqhP/xYdsOhwkH70ApGScvN1WbwKWvlKIlZV0ArqQ3M9 G1TdG9YCejQUs457rlKQqDD4rUXDAn5/QzJCTRSvX1z4jVbvVi+K4TV0ILt1RRg4meRg jc/CBFWA+3PsUP2kPW+QIJONY7fC1vZwQL3h7KTQSo1aVh1G/0WZnb2CXnukWuBSlduz 1NITLKH5b75Y99JrAIR999v3Y+m2PMFEOBA/o1mLyAK0RyhbZbC3rj6yxGYqVnVsCiwE eOvQ== X-Gm-Message-State: AOJu0YxXw3RnYLrkDfNkvM9hrjp3Wwd/llziwElYNVaYWrt6Rx4W8U3k hkgzFKK2Rk7oeciBlE7o/buQLt9nhElKzvdkIQF+hCENFskUFKLSGTzuLkmcS7KjjSgCkh23wR/ XAyIUNBYTK+Z/FzqYFYNlsWvgWIPTP+w= X-Gm-Gg: AY/fxX7Wz8cZjJEXWo2dOhXvyjzcjRManXcqMGBkK0aUzGZSulGqKXcMaTWFuutdj0g AckssiMUHJXj7ipFX6+qtCu3JnD2cIlOtiMRbLANF9w7WJy+DYXH2XaWUjyFQiclepFw0y3dMjX KK7GTSz70ISVSc3g8NEaDf3e2x00qOjALrt+I/NUsYVIvpuKmUmxYA40Z6UsHrfl/fAGMu9f+fT mQzWVCmxcg9ohE4PZimL6PO99gWY+hC6NHPLlyTHU+9soLezrDXrBJZulEVHUEP/QPjuv7/3U8t X80= X-Google-Smtp-Source: AGHT+IEZ6hLEtsZOq6EoetI7zq1FJNL9TTvTy4FYWbAhP/r6GZbcUJ0dQnA+dDrNe8hxOyS4la3BzDSeo/9hdAsZVzY= X-Received: by 2002:a05:651c:2112:b0:37b:b8c0:b5e1 with SMTP id 38308e7fff4ca-37fd0884d11mr1333171fa.27.1765503206808; Thu, 11 Dec 2025 17:33:26 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Gyan Sreejith Date: Thu, 11 Dec 2025 20:33:15 -0500 X-Gm-Features: AQt7F2ofv1NL_g3iYD32UyzQZVe19MXWYFcGEPJyZgTv5PmwwoASc9xMxYmPAZc Message-ID: Subject: Re: [Proposal] Adding Log File Capability to pg_createsubscriber To: Peter Smith Cc: pgsql-hackers@lists.postgresql.org, vignesh C Content-Type: multipart/alternative; boundary="0000000000007de05e0645b73ff4" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000007de05e0645b73ff4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the feedback, Peter. I am currently working on the SGML docs update, and will promptly get back with an update. For your second point, currently, all output goes directly to the console. I thought it made more sense to break it up into multiple files depending on what was being invoked. Do you have another opinion? Thank you once again, Gyan Sreejith On Thu, Dec 11, 2025 at 2:29=E2=80=AFAM Peter Smith = wrote: > On Wed, Dec 10, 2025 at 9:17=E2=80=AFAM Gyan Sreejith > wrote: > > > > Background: > > > > pg_createsubscriber currently outputs all messages (internal validation > messages, standby server start/stop logs, recovery progress output, and > output from utilities) directly to the console. As a result, users may fi= nd > debugging and handling errors difficult. It would be more convenient if > messages were separated and stored in different log files. There is alrea= dy > a similar implementation in pg_upgrade. > > > > Proposed Solution: > > > > Based on issues mentioned previously, I would like to propose a new > argument -l which can be specified for pg_createsubscriber. Usin= g > it would create the following log files: > > > > logdir/pg_createsubscriber_server.log which captures all logs related t= o > starting and stopping the standby server. > > > > logdir/pg_createsubscriber_resetwal.log which captures the output of > pg_resetwal > > > > logdir/pg_createsubscriber_internal.log which captures internal > diagnostic output from pg_createsubscriber (validations, checks, etc.) > > > > Overall, this proposed solution could make the pg_createsubscriber > command output messages more organized. The command would be easier to us= e > as users will only have to read individual log files rather than parse > through lots of possibly irrelevant output messages. I have attached the > patch for this change. > > > > Special thanks to Vignesh C. for his offlist guidance on this project. > > > > > > Regards, Gyan Sreejith > > > > Hi Gyan. > > I haven't yet looked at this patch in any detail, but here are some > quick comments: > > =3D=3D=3D=3D=3D=3D > > 1. > + printf(_(" -l, --logdir=3DLOGDIR location for the new log > directory\n")); > > The patch is missing SGML docs updates for pg_createsubscriber new > option, and any explanation of the split of logfiles. > > 2. > I might be mistaken, but IIUC it seems the splitting of the logfile > only works when --logdir is specified. Is that correct? > Why should --logdir have any side-effect other than assigning the log > destination folder? > > =3D=3D=3D=3D=3D=3D > Kind Regards, > Peter Smith. > Fujitsu Australia > --0000000000007de05e0645b73ff4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for the feedback, Peter.

I am currently work= ing on the SGML docs update, and will promptly get back with an update.=C2= =A0

For your second point, currently, all output goes=C2= =A0directly to the console. I thought it made more sense to break it up int= o multiple files depending on what was being invoked. Do you have another o= pinion?=C2=A0

Thank you once again,
Gyan Sreejith

=
On Thu, De= c 11, 2025 at 2:29=E2=80=AFAM Peter Smith <smithpb2250@gmail.com> wrote:
On Wed, Dec 10, 2025 at = 9:17=E2=80=AFAM Gyan Sreejith <gyan.sreejith@gmail.com> wrote:
>
> Background:
>
> pg_createsubscriber currently outputs all messages (internal validatio= n messages, standby server start/stop logs, recovery progress output, and o= utput from utilities) directly to the console. As a result, users may find = debugging and handling errors difficult. It would be more convenient if mes= sages were separated and stored in different log files. There is already a = similar implementation in pg_upgrade.
>
> Proposed Solution:
>
> Based on issues mentioned previously, I would like to propose a new ar= gument -l <logdir> which can be specified for pg_createsubscriber. Us= ing it would create the following log files:
>
> logdir/pg_createsubscriber_server.log which captures all logs related = to starting and stopping the standby server.
>
> logdir/pg_createsubscriber_resetwal.log which captures the output of p= g_resetwal
>
> logdir/pg_createsubscriber_internal.log which captures internal diagno= stic output from pg_createsubscriber (validations, checks, etc.)
>
> Overall, this proposed solution could make the pg_createsubscriber com= mand output messages more organized. The command would be easier to use as = users will only have to read individual log files rather than parse through= lots of possibly irrelevant output messages. I have attached the patch for= this change.
>
> Special thanks to Vignesh C. for his offlist guidance on this project.=
>
>
> Regards, Gyan Sreejith
>

Hi Gyan.

I haven't yet looked at this patch in any detail, but here are some
quick comments:

=3D=3D=3D=3D=3D=3D

1.
+ printf(_("=C2=A0 -l, --logdir=3DLOGDIR=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0location for the new log
directory\n"));

The patch is missing SGML docs updates for pg_createsubscriber new
option, and any explanation of the split of logfiles.

2.
I might be mistaken, but IIUC it seems the splitting of the logfile
only works when --logdir is specified. Is that correct?
Why should --logdir have any side-effect other than assigning the log
destination folder?

=3D=3D=3D=3D=3D=3D
Kind Regards,
Peter Smith.
Fujitsu Australia
--0000000000007de05e0645b73ff4--