Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id EE7FB9FB9C1 for ; Mon, 19 Feb 2007 11:53:27 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 14571-08-2 for ; Mon, 19 Feb 2007 11:53:12 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id 94A3B9FB9E4 for ; Mon, 19 Feb 2007 11:53:18 -0400 (AST) Received: from perhan.alvh.no-ip.org (216-155-79-222.bk1-dsl.surnet.cl [216.155.79.222]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id l1JFrG7I002188; Mon, 19 Feb 2007 07:53:16 -0800 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id AE70132A00; Mon, 19 Feb 2007 12:53:08 -0300 (CLST) Date: Mon, 19 Feb 2007 12:53:08 -0300 From: Alvaro Herrera To: Kris Kiger Cc: pgsql-admin@postgresql.org Subject: Re: Built-in log rotation Message-ID: <20070219155308.GN28395@alvh.no-ip.org> Mail-Followup-To: Kris Kiger , pgsql-admin@postgresql.org References: <45D9C390.6040907@musicrebellion.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45D9C390.6040907@musicrebellion.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: ClamAV version 0.88.5, clamav-milter version 0.88.5 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Mon, 19 Feb 2007 07:53:17 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.206 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200702/269 X-Sequence-Number: 24734 Kris Kiger wrote: > Greetings! I've been doing some research into log rotation software and > ran into this, while looking through the postgres site: > > "There is a built-in log rotation program, which you can use by setting > the configuration parameter redirect_stderr to true in postgresql.conf." > http://www.postgresql.org/docs/8.1/interactive/logfile-maintenance.html > > My question is, how does it rotate logs? It closes the old file and opens a new one -- new name, new file descriptor, so the problem you mention below doesn't exist anymore. > Does it perform a > copy/truncate of the logfile? I know in older versions of postgres, if > you tried to move the log file, and create one with the same name, the > server wouldn't actually write to it without a restart...at least in > linux it wouldn't. This code is "new" (only two years old). -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support