From tlqmail@yahoo.com Thu Jan 30 04:51:01 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4E235475F00 for ; Wed, 29 Jan 2003 23:51:01 -0500 (EST) Received: from web14806.mail.yahoo.com (web14806.mail.yahoo.com [216.136.224.222]) by postgresql.org (Postfix) with SMTP id 98EF247595A for ; Wed, 29 Jan 2003 23:51:00 -0500 (EST) Message-ID: <20030130045105.28846.qmail@web14806.mail.yahoo.com> Received: from [66.139.15.154] by web14806.mail.yahoo.com via HTTP; Wed, 29 Jan 2003 20:51:05 PST Date: Wed, 29 Jan 2003 20:51:05 -0800 (PST) From: Mintoo Lall Subject: Postgres server output log To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-966362568-1043902265=:28745" X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/333 X-Sequence-Number: 7175 --0-966362568-1043902265=:28745 Content-Type: text/plain; charset=us-ascii Hi Everybody, I am new to postgresql. I started my postgres using the command postmaster -D /usr/local/pgsql/data > logfile 2>&1 & Now after running it for some time I noticed that the size of this logfile has become very large. Is this logfile used to store any important information used by the database for recovery in case of crash? If no,is there any way I can specify a different log file withouting stopping the server ? Any help is appreciated. Thanks, Tarun --------------------------------- Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now --0-966362568-1043902265=:28745 Content-Type: text/html; charset=us-ascii

Hi Everybody,

I am new to postgresql. I started my postgres using the command

postmaster -D /usr/local/pgsql/data > logfile 2>&1 &

Now after running it for some time I noticed that the size of this logfile has become very large. Is this logfile used to store any important information used by the database for recovery in case of crash? If no,is there any way I can specify a different log file withouting stopping the server ?

Any help is appreciated.

Thanks,

Tarun



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now --0-966362568-1043902265=:28745-- From mallah@trade-india.com Thu Jan 30 05:17:50 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 01FF347595A for ; Thu, 30 Jan 2003 00:17:50 -0500 (EST) Received: from rtlocal.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by postgresql.org (Postfix) with SMTP id 91208477318 for ; Thu, 30 Jan 2003 00:17:37 -0500 (EST) Received: (qmail 10046 invoked from network); 30 Jan 2003 05:13:39 -0000 Received: from unknown (HELO system67.trade-india-local.com) (192.168.0.67) by infocom-236-129-del.trade-india.com with SMTP; 30 Jan 2003 05:13:39 -0000 From: "Rajesh Kumar Mallah." Organization: Infocom Network Limited. To: Mintoo Lall , pgsql-admin@postgresql.org Subject: Re: Postgres server output log Date: Thu, 30 Jan 2003 10:52:36 +0530 User-Agent: KMail/1.5 References: <20030130045105.28846.qmail@web14806.mail.yahoo.com> In-Reply-To: <20030130045105.28846.qmail@web14806.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200301301052.36984.mallah@trade-india.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/334 X-Sequence-Number: 7176 This is someones' elses' posting that i have preserved shud be useful. regds mallah. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` Well, the most correct way to do a logrotate is ( Redhat ): 1) Put on your postgresql.conf the following lines: syslog = 2 syslog_facility = 'LOCAL0' syslog_ident = 'postgres' 2) Put on the directory /etc/logrotate.d a file called 'postgres' with the following lines: /var/log/postgresql.log { compress rotate 2 size=10000k errors mendola@bigfoot.com create 0664 postgres postgres daily postrotate /usr/bin/killall -HUP syslogd endscript } change the email address of course :-) 3) Put the following line on your /etc/syslog.conf # Save postgresql logs LOCAL0.* /var/log/postgresql.log Ciao Gaetano ------------------------------------------------------- On Thursday 30 January 2003 10:21 am, Mintoo Lall wrote: > Hi Everybody, > > I am new to postgresql. I started my postgres using the command > > postmaster -D /usr/local/pgsql/data > logfile 2>&1 & > > Now after running it for some time I noticed that the size of this logfile > has become very large. Is this logfile used to store any important > information used by the database for recovery in case of crash? If no,is > there any way I can specify a different log file withouting stopping the > server ? > > Any help is appreciated. > > Thanks, > > Tarun > > > > --------------------------------- > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now -- -------------------------------------------- Regds Mallah Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)26152172 (221) (L) 9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace. From olly@lfix.co.uk Thu Jan 30 12:40:09 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id AD215475E45 for ; Thu, 30 Jan 2003 07:40:09 -0500 (EST) Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by postgresql.org (Postfix) with ESMTP id D51BE475AAC for ; Thu, 30 Jan 2003 07:40:08 -0500 (EST) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-32.mail.demon.net with esmtp (Exim 3.35 #1) id 18eDzG-0001wu-0W; Thu, 30 Jan 2003 12:40:11 +0000 Received: from localhost ([127.0.0.1] ident=olly) by linda.lfix.co.uk with esmtp (Exim 3.36 #1 (Debian)) id 18eDzG-0000hN-00; Thu, 30 Jan 2003 12:40:10 +0000 Subject: Re: Postgres server output log From: Oliver Elphick To: "Rajesh Kumar Mallah." Cc: Mintoo Lall , pgsql-admin@postgresql.org In-Reply-To: <200301301052.36984.mallah@trade-india.com> References: <20030130045105.28846.qmail@web14806.mail.yahoo.com> <200301301052.36984.mallah@trade-india.com> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1043930409.1112.203.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.1 Date: 30 Jan 2003 12:40:10 +0000 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/336 X-Sequence-Number: 7178 On Thu, 2003-01-30 at 05:22, Rajesh Kumar Mallah. wrote: > > This is someones' elses' posting that i have preserved > shud be useful. ... > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` > > Well, > the most correct way to do a logrotate is ( Redhat ): ... > 2) Put on the directory /etc/logrotate.d a file called > 'postgres' with the following lines: > > /var/log/postgresql.log { > compress > rotate 2 > size=10000k > errors mendola@bigfoot.com > create 0664 postgres postgres > daily > postrotate > /usr/bin/killall -HUP syslogd > endscript > } ... This won't work as it stands with PostgreSQL, because the hangup signal does not make the postmaster reopen the log file. Instead of that postrotate section, you need to use logrotate's copytruncate option, which will copy the logfile to another file before zeroing the logfile. Depending on what is being logged, you may want to change the permissions to 660; there may be stuff in the logs that you don't want to reveal to the world. (With copytruncate, I think the create option applies to the copy files rather than to the original logfile.) -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "The Lord knoweth how to deliver the godly out of temptations, and to reserve the unjust unto the day of judgment to be punished;" II Peter 2:9 From mallah@trade-india.com Thu Jan 30 14:07:37 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 27F0A4774A1 for ; Thu, 30 Jan 2003 09:07:37 -0500 (EST) Received: from rtlocal.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by postgresql.org (Postfix) with SMTP id 2C2EC475AAC for ; Thu, 30 Jan 2003 09:07:33 -0500 (EST) Received: (qmail 22271 invoked from network); 30 Jan 2003 14:03:55 -0000 Received: from unknown (HELO system67.trade-india-local.com) (192.168.0.67) by infocom-236-129-del.trade-india.com with SMTP; 30 Jan 2003 14:03:55 -0000 From: "Rajesh Kumar Mallah." Organization: Infocom Network Limited. To: Oliver Elphick , "Gaetano Mendola" Subject: Re: Postgres server output log Date: Thu, 30 Jan 2003 19:42:51 +0530 User-Agent: KMail/1.5 Cc: Mintoo Lall , pgsql-admin@postgresql.org References: <20030130045105.28846.qmail@web14806.mail.yahoo.com> <200301301052.36984.mallah@trade-india.com> <1043930409.1112.203.camel@linda.lfix.co.uk> In-Reply-To: <1043930409.1112.203.camel@linda.lfix.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200301301942.51018.mallah@trade-india.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/337 X-Sequence-Number: 7179 Hmm.. thank you for pointing out!. i have marked a Cc to Gaetano Mendola [ the original sinner ;-) ] regds mallah. On Thursday 30 January 2003 06:10 pm, Oliver Elphick wrote: > On Thu, 2003-01-30 at 05:22, Rajesh Kumar Mallah. wrote: > > This is someones' elses' posting that i have preserved > > shud be useful. > > ... > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` > > > > Well, > > the most correct way to do a logrotate is ( Redhat ): > > ... > > > 2) Put on the directory /etc/logrotate.d a file called > > 'postgres' with the following lines: > > > > /var/log/postgresql.log { > > compress > > rotate 2 > > size=10000k > > errors mendola@bigfoot.com > > create 0664 postgres postgres > > daily > > postrotate > > /usr/bin/killall -HUP syslogd > > endscript > > } > > ... > > This won't work as it stands with PostgreSQL, because the hangup signal > does not make the postmaster reopen the log file. Instead of that > postrotate section, you need to use logrotate's copytruncate option, > which will copy the logfile to another file before zeroing the logfile. > > Depending on what is being logged, you may want to change the > permissions to 660; there may be stuff in the logs that you don't want > to reveal to the world. (With copytruncate, I think the create option > applies to the copy files rather than to the original logfile.) -- Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)26152172 (221) (L) 9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace. From scrawford@pinpointresearch.com Thu Jan 30 17:10:38 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 40AA5475FC8 for ; Thu, 30 Jan 2003 12:10:38 -0500 (EST) Received: from polaris.pinpointresearch.com (66-7-238-176.cust.telepacific.net [66.7.238.176]) by postgresql.org (Postfix) with ESMTP id 8F938475F31 for ; Thu, 30 Jan 2003 12:10:37 -0500 (EST) Received: from there (66-7-238-179.cust.telepacific.net [66.7.238.179]) by polaris.pinpointresearch.com (Postfix) with SMTP id ADD63103EF; Thu, 30 Jan 2003 09:10:42 -0800 (PST) Content-Type: text/plain; charset="iso-8859-1" From: Steve Crawford Organization: Pinpoint Research To: Oliver Elphick , "Rajesh Kumar Mallah." Subject: Re: Postgres server output log Date: Thu, 30 Jan 2003 09:10:42 -0800 X-Mailer: KMail [version 1.3.1] Cc: Mintoo Lall , pgsql-admin@postgresql.org References: <20030130045105.28846.qmail@web14806.mail.yahoo.com> <200301301052.36984.mallah@trade-india.com> <1043930409.1112.203.camel@linda.lfix.co.uk> In-Reply-To: <1043930409.1112.203.camel@linda.lfix.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20030130171042.ADD63103EF@polaris.pinpointresearch.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/339 X-Sequence-Number: 7181 This is OK. The script isn't HUPping PostgreSQL, it is HUPping syslog. I think configuring PostgreSQL to write to syslog is the correct way to go. Once you decide to route the messages to syslogy you get everything that syslog offers such as: directing output to files, pipes or central log servers (in any combination) selectively dropping or writing messages based on severity many ready-made management tools like logrotate many ready-made monitoring tools like swatch and logwatch You can even choose alternate versions of the syslog daemon - I have one server runing msyslogd (Modular Syslog Daemon) with the PostgreSQL module installed so I can write syslog entries for a project directly into a PostgreSQL database for retrieval or analysis. So my advice is to complie/configure PostgreSQL to use syslog and use the myriad of available syslog tools for management and analysis. Cheers, Steve On Thursday 30 January 2003 4:40 am, Oliver Elphick wrote: > On Thu, 2003-01-30 at 05:22, Rajesh Kumar Mallah. wrote: > > This is someones' elses' posting that i have preserved > > shud be useful. > > ... > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` > > > > Well, > > the most correct way to do a logrotate is ( Redhat ): > > ... > > > 2) Put on the directory /etc/logrotate.d a file called > > 'postgres' with the following lines: > > > > /var/log/postgresql.log { > > compress > > rotate 2 > > size=10000k > > errors mendola@bigfoot.com > > create 0664 postgres postgres > > daily > > postrotate > > /usr/bin/killall -HUP syslogd > > endscript > > } > > ... > > This won't work as it stands with PostgreSQL, because the hangup signal > does not make the postmaster reopen the log file. Instead of that > postrotate section, you need to use logrotate's copytruncate option, > which will copy the logfile to another file before zeroing the logfile. > > Depending on what is being logged, you may want to change the > permissions to 660; there may be stuff in the logs that you don't want > to reveal to the world. (With copytruncate, I think the create option > applies to the copy files rather than to the original logfile.) From olly@lfix.co.uk Thu Jan 30 17:38:30 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4034F4774FF for ; Thu, 30 Jan 2003 12:38:30 -0500 (EST) Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by postgresql.org (Postfix) with ESMTP id 27A4F477592 for ; Thu, 30 Jan 2003 12:37:53 -0500 (EST) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-33.mail.demon.net with esmtp (Exim 3.35 #1) id 18eIdR-000DvQ-0X; Thu, 30 Jan 2003 17:37:57 +0000 Received: from localhost ([127.0.0.1] ident=olly) by linda.lfix.co.uk with esmtp (Exim 3.36 #1 (Debian)) id 18eIdQ-00021i-00; Thu, 30 Jan 2003 17:37:56 +0000 Subject: Re: Postgres server output log From: Oliver Elphick To: Steve Crawford Cc: "Rajesh Kumar Mallah." , Mintoo Lall , pgsql-admin@postgresql.org In-Reply-To: <20030130171042.ADD63103EF@polaris.pinpointresearch.com> References: <20030130045105.28846.qmail@web14806.mail.yahoo.com> <200301301052.36984.mallah@trade-india.com> <1043930409.1112.203.camel@linda.lfix.co.uk> <20030130171042.ADD63103EF@polaris.pinpointresearch.com> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1043948276.3785.5.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.1 Date: 30 Jan 2003 17:37:56 +0000 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/340 X-Sequence-Number: 7182 On Thu, 2003-01-30 at 17:10, Steve Crawford wrote: > This is OK. The script isn't HUPping PostgreSQL, it is HUPping syslog. Yes; I assumed this was a template to be adapted to PostgreSQL. My comments assume that logrotate is managing the file specified by -l to the postmaster. -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "The Lord knoweth how to deliver the godly out of temptations, and to reserve the unjust unto the day of judgment to be punished;" II Peter 2:9 From tgl@sss.pgh.pa.us Thu Jan 30 17:48:25 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 61904475C14 for ; Thu, 30 Jan 2003 12:48:25 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id B1137475BD7 for ; Thu, 30 Jan 2003 12:48:24 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h0UHl55u020467; Thu, 30 Jan 2003 12:47:06 -0500 (EST) To: Steve Crawford Cc: Oliver Elphick , "Rajesh Kumar Mallah." , Mintoo Lall , pgsql-admin@postgresql.org Subject: Re: Postgres server output log In-reply-to: <20030130171042.ADD63103EF@polaris.pinpointresearch.com> References: <20030130045105.28846.qmail@web14806.mail.yahoo.com> <200301301052.36984.mallah@trade-india.com> <1043930409.1112.203.camel@linda.lfix.co.uk> <20030130171042.ADD63103EF@polaris.pinpointresearch.com> Comments: In-reply-to Steve Crawford message dated "Thu, 30 Jan 2003 09:10:42 -0800" Date: Thu, 30 Jan 2003 12:47:05 -0500 Message-ID: <20466.1043948825@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/341 X-Sequence-Number: 7183 Steve Crawford writes: > I think configuring PostgreSQL to write to syslog is the correct way to go. syslog is a good alternative, but not perfect. I know of two strikes against it: 1. It can't catch everything that could go to a stderr log. While I think we've cleaned up all the backend code (there used to be lots of random fprintf's), there are messages that are not under our control. In particular, on most platforms any dynamic-linker error messages go to stderr --- when you're trying to debug why the backend can't load a .so file, this info is invaluable, but syslog can't capture it. 2. On some platforms, syslog is reputed to drop or truncate messages under heavy load. You have to figure out whether the many advantages of syslog outweigh these problems for your use. regards, tom lane From bruno@wolff.to Thu Jan 30 23:25:12 2003 X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 9D57B4778EF for ; Thu, 30 Jan 2003 18:25:12 -0500 (EST) Received: from wolff.to (wolff.to [66.93.249.74]) by postgresql.org (Postfix) with SMTP id DBC364778C2 for ; Thu, 30 Jan 2003 18:25:11 -0500 (EST) Received: (qmail 2425 invoked by uid 500); 30 Jan 2003 20:01:28 -0000 Date: Thu, 30 Jan 2003 14:01:28 -0600 From: Bruno Wolff III To: Tom Lane Cc: Steve Crawford , Oliver Elphick , "Rajesh Kumar Mallah." , Mintoo Lall , pgsql-admin@postgresql.org Subject: Re: Postgres server output log Message-ID: <20030130200128.GB2346@wolff.to> Mail-Followup-To: Tom Lane , Steve Crawford , Oliver Elphick , "Rajesh Kumar Mallah." , Mintoo Lall , pgsql-admin@postgresql.org References: <20030130045105.28846.qmail@web14806.mail.yahoo.com> <200301301052.36984.mallah@trade-india.com> <1043930409.1112.203.camel@linda.lfix.co.uk> <20030130171042.ADD63103EF@polaris.pinpointresearch.com> <20466.1043948825@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20466.1043948825@sss.pgh.pa.us> User-Agent: Mutt/1.3.25i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/350 X-Sequence-Number: 7192 Bernstein's multilog program (part of the daemontools package) may be useful. It is designed to read input from standard input and will do log rotation. Documentation is available at: http://cr.yp.to/daemontools/multilog.html From tlqmail@yahoo.com Fri Jan 31 02:16:36 2003 X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7100A4777C4 for ; Thu, 30 Jan 2003 21:16:36 -0500 (EST) Received: from web14801.mail.yahoo.com (web14801.mail.yahoo.com [216.136.224.217]) by postgresql.org (Postfix) with SMTP id CAA47477669 for ; Thu, 30 Jan 2003 21:16:35 -0500 (EST) Message-ID: <20030131021600.99119.qmail@web14801.mail.yahoo.com> Received: from [66.139.15.154] by web14801.mail.yahoo.com via HTTP; Thu, 30 Jan 2003 18:16:00 PST Date: Thu, 30 Jan 2003 18:16:00 -0800 (PST) From: Mintoo Lall Subject: Re: Postgres server output log To: pgsql-admin@postgresql.org In-Reply-To: <200301301052.36984.mallah@trade-india.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/352 X-Sequence-Number: 7194 Thanks guys for the replies. I am using redhat linux 8.0 and postgres 7.2.3. I started my postgresql server with the following command after making the changes pg_ctl start -D /usr/local/pgsql/data -o "-i" If I understood correctly the syslog should have created a log file at /var/log/postgresql.log but it didnt do it. I am not sure what is the correct way of starting the postgres after making the changes so as to use the syslog and the log rotation script. Any help is appreciated. Thanks, Tarun --- "Rajesh Kumar Mallah." wrote: > > > > This is someones' elses' posting that i have > preserved > shud be useful. > > regds > mallah. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` > > Well, > the most correct way to do a logrotate is ( Redhat > ): > > 1) Put on your postgresql.conf the following lines: > > syslog = 2 > syslog_facility = 'LOCAL0' > syslog_ident = 'postgres' > > 2) Put on the directory /etc/logrotate.d a file > called > 'postgres' with the following lines: > > /var/log/postgresql.log { > compress > rotate 2 > size=10000k > errors mendola@bigfoot.com > create 0664 postgres postgres > daily > postrotate > /usr/bin/killall -HUP syslogd > endscript > } > > change the email address of course :-) > > 3) Put the following line on your /etc/syslog.conf > > # Save postgresql logs > LOCAL0.* > /var/log/postgresql.log > > > Ciao > Gaetano > > ------------------------------------------------------- > > > On Thursday 30 January 2003 10:21 am, Mintoo Lall > wrote: > > Hi Everybody, > > > > I am new to postgresql. I started my postgres > using the command > > > > postmaster -D /usr/local/pgsql/data > logfile 2>&1 > & > > > > Now after running it for some time I noticed that > the size of this logfile > > has become very large. Is this logfile used to > store any important > > information used by the database for recovery in > case of crash? If no,is > > there any way I can specify a different log file > withouting stopping the > > server ? > > > > Any help is appreciated. > > > > Thanks, > > > > Tarun > > > > > > > > --------------------------------- > > Do you Yahoo!? > > Yahoo! Mail Plus - Powerful. Affordable. Sign up > now > > -- > > > -------------------------------------------- > Regds Mallah > Rajesh Kumar Mallah, > Project Manager (Development) > Infocom Network Limited, New Delhi > phone: +91(11)26152172 (221) (L) 9811255597 (M) > Visit http://www.trade-india.com , > India's Leading B2B eMarketplace. > > __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com From tlqmail@yahoo.com Fri Jan 31 19:26:48 2003 X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6AB29477547 for ; Fri, 31 Jan 2003 14:26:48 -0500 (EST) Received: from web14809.mail.yahoo.com (web14809.mail.yahoo.com [216.136.224.230]) by postgresql.org (Postfix) with SMTP id B3243477534 for ; Fri, 31 Jan 2003 14:26:47 -0500 (EST) Message-ID: <20030131192451.82139.qmail@web14809.mail.yahoo.com> Received: from [66.139.15.154] by web14809.mail.yahoo.com via HTTP; Fri, 31 Jan 2003 11:24:51 PST Date: Fri, 31 Jan 2003 11:24:51 -0800 (PST) From: Mintoo Lall Subject: Re: Postgres server output log To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-852217479-1044041091=:82121" X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/354 X-Sequence-Number: 7196 --0-852217479-1044041091=:82121 Content-Type: text/plain; charset=us-ascii Thanks guys for the replies.I am using redhat linux 8.0 and postgres 7.2.3. Istarted my postgresql server with the followingcommand after making the changes pg_ctl start -D /usr/local/pgsql/data -o "-i"If I understood correctly the syslog should havecreated a log file at /var/log/postgresql.log but itdidnt do it. I am not sure what is the correct way ofstarting the postgres after making the changes so asto use the syslog and the log rotation script. Anyhelp is appreciated.Thanks,Tarun--- "Rajesh Kumar Mallah." wrote:> > > > This is someones' elses' posting that i have> preserved> shud be useful.> > regds> mallah.> >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`> > Well,> the most correct way to do a logrotate is ( Redhat> ):> > 1) Put on your postgresql.conf the following lines:> > syslog = 2> syslog_facility = 'LOCAL0'> syslog_ident = 'postgres'> > 2) Put on the directory /etc/logrotate.d a file> called> 'postgres' with the followin g lines:> > /var/log/postgresql.log {> compress> rotate 2> size=10000k> errors mendola@bigfoot.com> create 0664 postgres postgres> daily> postrotate> /usr/bin/killall -HUP syslogd> endscript> }> > change the email address of course :-)> > 3) Put the following line on your /etc/syslog.conf> > # Save postgresql logs> LOCAL0.*> /var/log/postgresql.log> > > Ciao> Gaetano> >-------------------------------------------------------> > > On Thursday 30 January 2003 10:21 am, Mintoo Lall> wrote:> > Hi Everybody,> >> > I am new to postgresql. I started my postgres> using the command> >> > postmaster -D /usr/local/pgsql/data > logfile 2>&1> &> >> > Now after running it for some time I noticed that> the size of this logfile> > has become very large. Is this logfile used to> store any important> > information used by the database for recovery in> case of crash? If no,is> > there any way I can specify a different log file> withouting stopping th e> > server ?> >> > Any help is appreciated.> >> > Thanks,> >> > Tarun> >> >> >> > ---------------------------------> > Do you Yahoo!?> > Yahoo! Mail Plus - Powerful. Affordable. Sign up> now> > -- > > > --------------------------------------------> Regds Mallah> Rajesh Kumar Mallah,> Project Manager (Development)> Infocom Network Limited, New Delhi> phone: +91(11)26152172 (221) (L) 9811255597 (M)> Visit http://www.trade-india.com ,> India's Leading B2B eMarketplace.> > __________________________________________________Do you Yahoo!?Yahoo! Mail Plus - Powerful. Affordable. Sign up now.http://mailplus.yahoo.com---------------------------(end of broadcast)---------------------------TIP 4: Don't 'kill -9' the postmaster --------------------------------- Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now --0-852217479-1044041091=:82121 Content-Type: text/html; charset=us-ascii
Thanks guys for the replies.

I am using redhat linux 8.0 and postgres 7.2.3. I
started my postgresql server with the following
command after making the changes 
pg_ctl start -D /usr/local/pgsql/data   -o "-i"

If I understood correctly the syslog should have
created a log file at /var/log/postgresql.log but it
didnt do it. I am not sure what is the correct way of
starting the postgres after making the changes so as
to use the syslog and the log rotation script. Any
help is appreciated.

Thanks,
Tarun


--- "Rajesh Kumar Mallah." <mallah@trade-india.com>
wrote:
> 
> 
> 
> This is someones' elses' posting that i have
> preserved
> shud be useful.
> 
> regds
> mallah.
> 
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
> 
> Well,
> the most correct way to do a logrotate is ( Redhat
> ):
> 
> 1) Put on your postgresql.conf the following lines:
> 
> syslog = 2
> syslog_facility = 'LOCAL0'
> syslog_ident = 'postgres'
> 
> 2)  Put on the directory /etc/logrotate.d a file
> called
> 'postgres' with the following lines:
> 
> /var/log/postgresql.log {
>     compress
>     rotate 2
>     size=10000k
>     errors mendola@bigfoot.com
>     create 0664 postgres postgres
>     daily
>     postrotate
>              /usr/bin/killall -HUP syslogd
>     endscript
> }
> 
> change the email address of course :-)
> 
> 3) Put the following line on your /etc/syslog.conf
> 
> # Save postgresql logs
> LOCAL0.*
> /var/log/postgresql.log
> 
> 
> Ciao
> Gaetano
> 
>
-------------------------------------------------------
> 
> 
> On Thursday 30 January 2003 10:21 am, Mintoo Lall
> wrote:
> > Hi Everybody,
> >
> > I am new to postgresql. I started my postgres
> using the command
> >
> > postmaster -D /usr/local/pgsql/data > logfile 2>&1
> &
> >
> > Now after running it for some time I noticed that
> the size of this logfile
> > has become very large. Is this logfile used to
> store any important
> > information used by the database for recovery in
> case of crash? If no,is
> > there any way I can specify a different log file
> withouting stopping the
> > server ?
> >
> > Any help is appreciated.
> >
> > Thanks,
> >
> > Tarun
> >
> >
> >
> > ---------------------------------
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now
> 
> -- 
> 
> 
> --------------------------------------------
>                                 Regds Mallah
> Rajesh Kumar Mallah,
> Project Manager (Development)
> Infocom Network Limited, New Delhi
> phone: +91(11)26152172 (221) (L) 9811255597 (M)
> Visit http://www.trade-india.com ,
> India's Leading B2B eMarketplace.
> 
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

---------------------------(end of 
broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now --0-852217479-1044041091=:82121-- From tlqmail@yahoo.com Fri Jan 31 19:27:08 2003 X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E512E4762C8 for ; Fri, 31 Jan 2003 14:27:08 -0500 (EST) Received: from web14805.mail.yahoo.com (web14805.mail.yahoo.com [216.136.224.221]) by postgresql.org (Postfix) with SMTP id 3EC0D475E52 for ; Fri, 31 Jan 2003 14:27:08 -0500 (EST) Message-ID: <20030131192454.25773.qmail@web14805.mail.yahoo.com> Received: from [66.139.15.154] by web14805.mail.yahoo.com via HTTP; Fri, 31 Jan 2003 11:24:54 PST Date: Fri, 31 Jan 2003 11:24:54 -0800 (PST) From: Mintoo Lall Subject: Re: Postgres server output log To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1237175156-1044041094=:25095" X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/355 X-Sequence-Number: 7197 --0-1237175156-1044041094=:25095 Content-Type: text/plain; charset=us-ascii Thanks guys for the replies.I am using redhat linux 8.0 and postgres 7.2.3. Istarted my postgresql server with the followingcommand after making the changes pg_ctl start -D /usr/local/pgsql/data -o "-i"If I understood correctly the syslog should havecreated a log file at /var/log/postgresql.log but itdidnt do it. I am not sure what is the correct way ofstarting the postgres after making the changes so asto use the syslog and the log rotation script. Anyhelp is appreciated.Thanks,Tarun--- "Rajesh Kumar Mallah." wrote:> > > > This is someones' elses' posting that i have> preserved> shud be useful.> > regds> mallah.> >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`> > Well,> the most correct way to do a logrotate is ( Redhat> ):> > 1) Put on your postgresql.conf the following lines:> > syslog = 2> syslog_facility = 'LOCAL0'> syslog_ident = 'postgres'> > 2) Put on the directory /etc/logrotate.d a file> called> 'postgres' with the followin g lines:> > /var/log/postgresql.log {> compress> rotate 2> size=10000k> errors mendola@bigfoot.com> create 0664 postgres postgres> daily> postrotate> /usr/bin/killall -HUP syslogd> endscript> }> > change the email address of course :-)> > 3) Put the following line on your /etc/syslog.conf> > # Save postgresql logs> LOCAL0.*> /var/log/postgresql.log> > > Ciao> Gaetano> >-------------------------------------------------------> > > On Thursday 30 January 2003 10:21 am, Mintoo Lall> wrote:> > Hi Everybody,> >> > I am new to postgresql. I started my postgres> using the command> >> > postmaster -D /usr/local/pgsql/data > logfile 2>&1> &> >> > Now after running it for some time I noticed that> the size of this logfile> > has become very large. Is this logfile used to> store any important> > information used by the database for recovery in> case of crash? If no,is> > there any way I can specify a different log file> withouting stopping th e> > server ?> >> > Any help is appreciated.> >> > Thanks,> >> > Tarun> >> >> >> > ---------------------------------> > Do you Yahoo!?> > Yahoo! Mail Plus - Powerful. Affordable. Sign up> now> > -- > > > --------------------------------------------> Regds Mallah> Rajesh Kumar Mallah,> Project Manager (Development)> Infocom Network Limited, New Delhi> phone: +91(11)26152172 (221) (L) 9811255597 (M)> Visit http://www.trade-india.com ,> India's Leading B2B eMarketplace.> > __________________________________________________Do you Yahoo!?Yahoo! Mail Plus - Powerful. Affordable. Sign up now.http://mailplus.yahoo.com---------------------------(end of broadcast)---------------------------TIP 4: Don't 'kill -9' the postmaster --------------------------------- Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now --0-1237175156-1044041094=:25095 Content-Type: text/html; charset=us-ascii
Thanks guys for the replies.

I am using redhat linux 8.0 and postgres 7.2.3. I
started my postgresql server with the following
command after making the changes 
pg_ctl start -D /usr/local/pgsql/data   -o "-i"

If I understood correctly the syslog should have
created a log file at /var/log/postgresql.log but it
didnt do it. I am not sure what is the correct way of
starting the postgres after making the changes so as
to use the syslog and the log rotation script. Any
help is appreciated.

Thanks,
Tarun


--- "Rajesh Kumar Mallah." <mallah@trade-india.com>
wrote:
> 
> 
> 
> This is someones' elses' posting that i have
> preserved
> shud be useful.
> 
> regds
> mallah.
> 
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
> 
> Well,
> the most correct way to do a logrotate is ( Redhat
> ):
> 
> 1) Put on your postgresql.conf the following lines:
> 
> syslog = 2
> syslog_facility = 'LOCAL0'
> syslog_ident = 'postgres'
> 
> 2)  Put on the directory /etc/logrotate.d a file
> called
> 'postgres' with the following lines:
> 
> /var/log/postgresql.log {
>     compress
>     rotate 2
>     size=10000k
>     errors mendola@bigfoot.com
>     create 0664 postgres postgres
>     daily
>     postrotate
>              /usr/bin/killall -HUP syslogd
>     endscript
> }
> 
> change the email address of course :-)
> 
> 3) Put the following line on your /etc/syslog.conf
> 
> # Save postgresql logs
> LOCAL0.*
> /var/log/postgresql.log
> 
> 
> Ciao
> Gaetano
> 
>
-------------------------------------------------------
> 
> 
> On Thursday 30 January 2003 10:21 am, Mintoo Lall
> wrote:
> > Hi Everybody,
> >
> > I am new to postgresql. I started my postgres
> using the command
> >
> > postmaster -D /usr/local/pgsql/data > logfile 2>&1
> &
> >
> > Now after running it for some time I noticed that
> the size of this logfile
> > has become very large. Is this logfile used to
> store any important
> > information used by the database for recovery in
> case of crash? If no,is
> > there any way I can specify a different log file
> withouting stopping the
> > server ?
> >
> > Any help is appreciated.
> >
> > Thanks,
> >
> > Tarun
> >
> >
> >
> > ---------------------------------
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now
> 
> -- 
> 
> 
> --------------------------------------------
>                                 Regds Mallah
> Rajesh Kumar Mallah,
> Project Manager (Development)
> Infocom Network Limited, New Delhi
> phone: +91(11)26152172 (221) (L) 9811255597 (M)
> Visit http://www.trade-india.com ,
> India's Leading B2B eMarketplace.
> 
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

---------------------------(end of 
broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now --0-1237175156-1044041094=:25095-- From pgman@candle.pha.pa.us Sun Feb 2 10:13:54 2003 X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 48DE14767E9 for ; Sun, 2 Feb 2003 05:13:54 -0500 (EST) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by postgresql.org (Postfix) with ESMTP id 47E8A477665 for ; Sun, 2 Feb 2003 04:54:39 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id h129sRe17404; Sun, 2 Feb 2003 04:54:27 -0500 (EST) From: Bruce Momjian Message-Id: <200302020954.h129sRe17404@candle.pha.pa.us> Subject: Re: Postgres server output log In-Reply-To: <200301301052.36984.mallah@trade-india.com> To: "Rajesh Kumar Mallah." Date: Sun, 2 Feb 2003 04:54:27 -0500 (EST) Cc: Mintoo Lall , pgsql-admin@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/19 X-Sequence-Number: 7217 Is all this stuff in our docs? --------------------------------------------------------------------------- Rajesh Kumar Mallah. wrote: > > > > This is someones' elses' posting that i have preserved > shud be useful. > > regds > mallah. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` > > Well, > the most correct way to do a logrotate is ( Redhat ): > > 1) Put on your postgresql.conf the following lines: > > syslog = 2 > syslog_facility = 'LOCAL0' > syslog_ident = 'postgres' > > 2) Put on the directory /etc/logrotate.d a file called > 'postgres' with the following lines: > > /var/log/postgresql.log { > compress > rotate 2 > size=10000k > errors mendola@bigfoot.com > create 0664 postgres postgres > daily > postrotate > /usr/bin/killall -HUP syslogd > endscript > } > > change the email address of course :-) > > 3) Put the following line on your /etc/syslog.conf > > # Save postgresql logs > LOCAL0.* > /var/log/postgresql.log > > > Ciao > Gaetano > > ------------------------------------------------------- > > > On Thursday 30 January 2003 10:21 am, Mintoo Lall wrote: > > Hi Everybody, > > > > I am new to postgresql. I started my postgres using the command > > > > postmaster -D /usr/local/pgsql/data > logfile 2>&1 & > > > > Now after running it for some time I noticed that the size of this logfile > > has become very large. Is this logfile used to store any important > > information used by the database for recovery in case of crash? If no,is > > there any way I can specify a different log file withouting stopping the > > server ? > > > > Any help is appreciated. > > > > Thanks, > > > > Tarun > > > > > > > > --------------------------------- > > Do you Yahoo!? > > Yahoo! Mail Plus - Powerful. Affordable. Sign up now > > -- > > > -------------------------------------------- > Regds Mallah > Rajesh Kumar Mallah, > Project Manager (Development) > Infocom Network Limited, New Delhi > phone: +91(11)26152172 (221) (L) 9811255597 (M) > Visit http://www.trade-india.com , > India's Leading B2B eMarketplace. > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > -- 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 From mail@tilo-schwarz.de Sun Feb 2 14:46:34 2003 X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6040A475425 for ; Sun, 2 Feb 2003 09:46:34 -0500 (EST) Received: from post.webmailer.de (natsmtp00.webmailer.de [192.67.198.74]) by postgresql.org (Postfix) with ESMTP id 547774753A1 for ; Sun, 2 Feb 2003 09:46:33 -0500 (EST) Received: from dell (p509178E5.dip.t-dialin.net [80.145.120.229]) by post.webmailer.de (8.9.3/8.8.7) with ESMTP id PAA27247; Sun, 2 Feb 2003 15:46:05 +0100 (MET) Content-Type: text/plain; charset="iso-8859-1" From: Tilo Schwarz To: Bruce Momjian , pgsql-admin@postgresql.org Subject: Re: Postgres server output log Date: Sun, 2 Feb 2003 15:47:30 +0100 User-Agent: KMail/1.4.3 References: <200302020954.h129sRe17404@candle.pha.pa.us> In-Reply-To: <200302020954.h129sRe17404@candle.pha.pa.us> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200302021547.30797.mail@tilo-schwarz.de> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/26 X-Sequence-Number: 7224 Bruce Momjian writes: > Is all this stuff in our docs? At least I didn't find it, while I was searching for "how to logrotate the= =20 postmaster logfile properly" last week (IIRC only the "pipe postmasters=20 output into a logrotate script" possibility is discussed, not the way like = 2)=20 below). Finally I had a look how SuSE does it and it's very similar to 2)= =20 shown below (but they have the "copytruncate" option). Best regards, Tilo > > -------------------------------------------------------------------------= -- > > Rajesh Kumar Mallah. wrote: > > This is someones' elses' posting that i have preserved > > shud be useful. > > > > regds > > mallah. > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` > > > > Well, > > the most correct way to do a logrotate is ( Redhat ): > > > > 1) Put on your postgresql.conf the following lines: > > > > syslog =3D 2 > > syslog_facility =3D 'LOCAL0' > > syslog_ident =3D 'postgres' > > > > 2) Put on the directory /etc/logrotate.d a file called > > 'postgres' with the following lines: > > > > /var/log/postgresql.log { > > compress > > rotate 2 > > size=3D10000k > > errors mendola@bigfoot.com > > create 0664 postgres postgres > > daily > > postrotate > > /usr/bin/killall -HUP syslogd > > endscript > > } > > > > change the email address of course :-) > > > > 3) Put the following line on your /etc/syslog.conf > > > > # Save postgresql logs > > LOCAL0.* > > /var/log/postgresql.log > > > > > > Ciao > > Gaetano > > > > ------------------------------------------------------- > > > > On Thursday 30 January 2003 10:21 am, Mintoo Lall wrote: > > > Hi Everybody, > > > > > > I am new to postgresql. I started my postgres using the command > > > > > > postmaster -D /usr/local/pgsql/data > logfile 2>&1 & > > > > > > Now after running it for some time I noticed that the size of this > > > logfile has become very large. Is this logfile used to store any > > > important information used by the database for recovery in case of > > > crash? If no,is there any way I can specify a different log file > > > withouting stopping the server ? > > > > > > Any help is appreciated. > > > > > > Thanks, > > > > > > Tarun > > > > > > > > > > > > --------------------------------- > > > Do you Yahoo!? > > > Yahoo! Mail Plus - Powerful. Affordable. Sign up now > > > > -- > > > > > > -------------------------------------------- > > Regds Mallah > > Rajesh Kumar Mallah, > > Project Manager (Development) > > Infocom Network Limited, New Delhi > > phone: +91(11)26152172 (221) (L) 9811255597 (M) > > Visit http://www.trade-india.com , > > India's Leading B2B eMarketplace. > > > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org