X-Original-To: pgsql-patches-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 81E668B9EE2 for ; Sat, 12 Feb 2005 23:48:28 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 32493-07 for ; Sat, 12 Feb 2005 23:48:23 +0000 (GMT) Received: from candle.pha.pa.us (candle.pha.pa.us [64.139.89.126]) by svr1.postgresql.org (Postfix) with ESMTP id 8FB0C8B9B2B for ; Sat, 12 Feb 2005 23:48:19 +0000 (GMT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id j1CNmIo02365; Sat, 12 Feb 2005 18:48:18 -0500 (EST) From: Bruce Momjian Message-Id: <200502122348.j1CNmIo02365@candle.pha.pa.us> Subject: Re: [ADMIN] Migration of log features from 7.4 to 8.0 In-Reply-To: <41E5515E.5010307@gmail.com> To: =?ISO-8859-2?Q?Sz=FBcs_G=E1bor?= Date: Sat, 12 Feb 2005 18:48:18 -0500 (EST) Cc: PostgreSQL-patches X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=ELM1108252098-5965-1_ Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.015 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/80 X-Sequence-Number: 14650 --ELM1108252098-5965-1_ Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UNKNOWN-8BIT Szûcs Gábor wrote: > Dear Gurus, > > Please show me to the right manual/discussion if my questions are already > answered/solved. > > 1. DEBUG message level separation: > > In v7.3 there were the annoying DEBUG messages Start/CloseTransactCommand. > In v7.4 you could eliminate them from user DEBUG messages by logging from > DEBUG2 level. > In v8.0.0rc4, they are back at DEBUG2 level. > > Is there a way to eliminate them AND keep user DEBUG messages (i.e. > plpgsql's "RAISE DEBUG") I looked at the plpgsql code and saw this: | K_DEBUG { $$ = DEBUG2; } I think that should be DEBUG1. This was pushed to DEBUG2 from DEBUG1 in 7.4 because we moved GUC debug output from LOG to DEBUG1: date: 2003/05/27 17:49:47; author: momjian; state: Exp; lines: +2 -2 Make debug_ GUC varables output DEBUG1 rather than LOG, and mention in docs that CLIENT/LOG_MIN_MESSAGES now controls debug_* output location. Doc changes included. I think because this is a plpgsql-specified output of DEBUG it makes sense it should be DEBUG1 too. The attached patch moves a plpgsql DEBUG to DEBUG1. It also fixes a few place where DEBUG1 usage has crept in that should be DEBUG2. This will be in 8.1 > 2. CONTEXTs and HINTs > > Looked up all the lines in postgresql.conf, but couldn't find the one to > turn CONTEXT and HINT lines after notices or errors. They proved to be very > useful, but can't make them be logged in v8. Is there a way? Sure: log_error_verbosity = default # terse, default, or verbose messages > > 3. redirect_stderr bogus? > > Activating redirect_stderr, setting log_dir, log_file and all the rotate > params, it looked to me that all output the logger produced were 'db system > ready' and 'shut down', and not even these lines appeared in the log file. > May it be a bug, or simply the fact that a nonempty file already existed > (from redirected stdout, as described above)< Sorry, I am confused on how to answer this. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 --ELM1108252098-5965-1_ Content-Transfer-Encoding: 7bit Content-Type: text/plain Content-Disposition: inline; filename="/bjm/diff" Index: src/backend/access/transam/slru.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/access/transam/slru.c,v retrieving revision 1.23 diff -c -c -r1.23 slru.c *** src/backend/access/transam/slru.c 31 Dec 2004 21:59:29 -0000 1.23 --- src/backend/access/transam/slru.c 12 Feb 2005 23:41:53 -0000 *************** *** 944,950 **** if (doDeletions) { snprintf(path, MAXPGPATH, "%s/%s", ctl->Dir, clde->d_name); ! ereport(DEBUG1, (errmsg("removing file \"%s\"", path))); unlink(path); } --- 944,950 ---- if (doDeletions) { snprintf(path, MAXPGPATH, "%s/%s", ctl->Dir, clde->d_name); ! ereport(DEBUG2, (errmsg("removing file \"%s\"", path))); unlink(path); } Index: src/backend/access/transam/xlog.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v retrieving revision 1.180 diff -c -c -r1.180 xlog.c *** src/backend/access/transam/xlog.c 31 Dec 2004 21:59:30 -0000 1.180 --- src/backend/access/transam/xlog.c 12 Feb 2005 23:41:57 -0000 *************** *** 2065,2071 **** * restore, or because the administrator has specified the restore * program incorrectly. We have to assume the former. */ ! ereport(DEBUG1, (errmsg("could not restore file \"%s\" from archive: return code %d", xlogfname, rc))); --- 2065,2071 ---- * restore, or because the administrator has specified the restore * program incorrectly. We have to assume the former. */ ! ereport(DEBUG2, (errmsg("could not restore file \"%s\" from archive: return code %d", xlogfname, rc))); *************** *** 4893,4899 **** END_CRIT_SECTION(); if (!shutdown) ! ereport(DEBUG1, (errmsg("checkpoint starting"))); CheckPointCLOG(); --- 4893,4899 ---- END_CRIT_SECTION(); if (!shutdown) ! ereport(DEBUG2, (errmsg("checkpoint starting"))); CheckPointCLOG(); *************** *** 4994,5000 **** TruncateSUBTRANS(GetOldestXmin(true)); if (!shutdown) ! ereport(DEBUG1, (errmsg("checkpoint complete; %d transaction log file(s) added, %d removed, %d recycled", nsegsadded, nsegsremoved, nsegsrecycled))); --- 4994,5000 ---- TruncateSUBTRANS(GetOldestXmin(true)); if (!shutdown) ! ereport(DEBUG2, (errmsg("checkpoint complete; %d transaction log file(s) added, %d removed, %d recycled", nsegsadded, nsegsremoved, nsegsrecycled))); Index: src/backend/libpq/hba.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/libpq/hba.c,v retrieving revision 1.136 diff -c -c -r1.136 hba.c *** src/backend/libpq/hba.c 31 Dec 2004 21:59:50 -0000 1.136 --- src/backend/libpq/hba.c 12 Feb 2005 23:41:58 -0000 *************** *** 1640,1646 **** return STATUS_ERROR; } ! ereport(DEBUG1, (errmsg("Ident protocol identifies remote user as \"%s\"", ident_user))); --- 1640,1646 ---- return STATUS_ERROR; } ! ereport(DEBUG2, (errmsg("Ident protocol identifies remote user as \"%s\"", ident_user))); --ELM1108252098-5965-1_--