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 1vTb7K-005YCR-0S for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Dec 2025 07:29:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vTb7J-002lLE-0U for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Dec 2025 07:29:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vTb7I-002lL5-2p for pgsql-hackers@lists.postgresql.org; Thu, 11 Dec 2025 07:29:37 +0000 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vTb7H-0007hx-0q for pgsql-hackers@lists.postgresql.org; Thu, 11 Dec 2025 07:29:37 +0000 Received: by mail-qv1-xf2e.google.com with SMTP id 6a1803df08f44-88057f5d041so7202916d6.1 for ; Wed, 10 Dec 2025 23:29:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765438173; x=1766042973; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=fLXlh7lSNtOtQwrdrw2d5uzR9/tKlSxOuwcpIH2XwR0=; b=asSwdJ1J0LE10+GakuRa8UAGVSAmUnrECtwPxKF2uSXknSpAWYnfAASOIffQ8dkQdv fXPktZcWwtR56MsvJRfhXIFVFK5gS+N5KGhvhh7N6D4VfweveTQgP8tJ3p1cbv3nFCMf IC2lc1mkcaNcjQFamZyErb8TJNWWsL2bryj4tQGuaEYpUbrG3oms0WkOdQTJdKmmUUkZ hnVkXwE8BcqBu8990QuenpDkj4fImsl2mE/7e2sKhyZpmHl0D46bzRVMZl0gET3DJLeY gmq9+oedtw2mOIt7OQDIfh7wXJDPA9nEBMw3/fO8r7OB74fZNW0opILVOruM7XDxhiHe DyPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765438173; x=1766042973; h=content-transfer-encoding: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=fLXlh7lSNtOtQwrdrw2d5uzR9/tKlSxOuwcpIH2XwR0=; b=faLhQA2r+f4Vw/5VSg/zRMq2LhEvzgICp/1nGn8Kz51ax+ecAh3kAGsucusfUYPwuW f6f10b0iu9zuwc4WkRmF+DjlP0rMehz4LVBKA+ls6xRozekliq7slI1Y7roKyUkNFpHx 3zpCIS31eQhrvVpUtRCHwB+RkTvGvRkhXS6RgRrqbvAYNTSeyv0UVH0texr4eHWtyhwt 0Aj8N3tZdEc/J8SQjOqZ/skbR3+E/YODSDXw+j13v/oDDVqUt92WIYMJN9k8+7xjbzmZ +kjVSQYUpG7jqJhsl798lzcKnsYnF48tmGZ3e1pnavFRcEfkBqsDxzNwRJ4nituTXpUi ariA== X-Gm-Message-State: AOJu0Yz3VXUWHSNYZgHkzMxQ41XqTTNJPooSLLRaIK1rOsfwMZHyfySb cAAjXR6ERHAOAqIH7WT88OripS/ntcm+m9hZUDzdNt8acEDTLHatFO7c9OxduW2klQ2HZfkQAYI OZHUXwxhSQXb0wZst0aEG6L55G7iQqfU= X-Gm-Gg: AY/fxX7fhZxaD/XT13cIBJklvX5TqMtvpnjtdQqZQcIMI8QFYZnDYP9HLEoLOe7pZwG XdcTwWFoJ6S1xvHgGW7SPCwem9wll/nVIItRyolTlWgUFka+7DFnWQJneZ5LEAloK0ET5BjS6k4 p98SczAlkPwqouQgn72Es+H/UTrIYn6dWWo5zR8nPH9Mkq4x0UFkJLwLRayBbUL+KBRsnhfypfE JYV5RjF33egvabGstrSJxbOS6sBG6EZRdJPj5Pi5qMLKsq08y9aJPSldAOLjX9pHQy+gXxqRydi oyrtbnqsmRYmJjTMuFFl6i+uZvTu4DnqpeROWGMY X-Google-Smtp-Source: AGHT+IE061uLQp2kjHLAwZLsxFR9IaJ/6tiGBkZRLljU2vKi54abBTy3s3e48fZgspQOqKDc2Npyi6NgA9NlYqm0MTw= X-Received: by 2002:a05:622a:5c91:b0:4ee:268f:baa2 with SMTP id d75a77b69052e-4f1b19faffbmr72502281cf.27.1765438173511; Wed, 10 Dec 2025 23:29:33 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Thu, 11 Dec 2025 18:29:07 +1100 X-Gm-Features: AQt7F2rfm7GAu1ex4Uyn7cv3ttVYia3pdmc8OOE1-vmKrthnxtxNz6NTfApXHfg Message-ID: Subject: Re: [Proposal] Adding Log File Capability to pg_createsubscriber To: Gyan Sreejith Cc: pgsql-hackers@lists.postgresql.org, vignesh C Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Dec 10, 2025 at 9:17=E2=80=AFAM Gyan Sreejith wrote: > > Background: > > pg_createsubscriber currently outputs all messages (internal validation m= essages, standby server start/stop logs, recovery progress output, and outp= ut from utilities) directly to the console. As a result, users may find deb= ugging and handling errors difficult. It would be more convenient if messag= es were separated and stored in different log files. There is already a sim= ilar implementation in pg_upgrade. > > Proposed Solution: > > Based on issues mentioned previously, I would like to propose a new argum= ent -l which can be specified for pg_createsubscriber. Using it wo= uld 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 pg_r= esetwal > > logdir/pg_createsubscriber_internal.log which captures internal diagnosti= c output from pg_createsubscriber (validations, checks, etc.) > > Overall, this proposed solution could make the pg_createsubscriber comman= d output messages more organized. The command would be easier to use as use= rs will only have to read individual log files rather than parse through lo= ts of possibly irrelevant output messages. I have attached the patch for th= is 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