Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 2E4AF9FB214 for ; Thu, 11 Jan 2007 08:24:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 88519-07-3 for ; Thu, 11 Jan 2007 08:23:33 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from perth.mailnetwork.co.uk (perth.mailnetwork.co.uk [80.175.28.46]) by postgresql.org (Postfix) with ESMTP id 64ED39FB1FB for ; Thu, 11 Jan 2007 08:23:49 -0400 (AST) Received: from [213.146.139.35] (port=62329 helo=[172.21.18.250]) by perth.mailnetwork.co.uk with esmtpa (Exim 4.63) (envelope-from ) id 1H4yyD-0003JF-70; Thu, 11 Jan 2007 12:23:49 +0000 Message-ID: <45A62C7A.9040504@mailnetwork.co.uk> Date: Thu, 11 Jan 2007 12:24:26 +0000 From: "Andy Shellam (Mailing Lists)" User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: Marc Mamin CC: pgsql-admin@postgresql.org Subject: Re: configuring the postmaster.log References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/98 X-Sequence-Number: 24254 Marc Mamin wrote: > Hello, > > > I'm confused about the logging destination parameters in postgresql.conf > > > My Problem is that the postmaster.log is getting too large and I want > to roll it (once per day) > > Following parameters apply to optional postgresql...log. > > > log_rotation_age = 1440 > log_filename = 'postgresql-%Y-%m-%d_%H.log' > > > Is there a way to use a similar definition for the postmaster.log ? That is for the postmaster log - AFAIK there's only one log destination (syslog or a standard file.) > > When I generate postgresql...log files, are log messages written in both > postmaster.log and postgresql.log ? I've never come across there being two files - "log_filename" says where log messages are written - there aren't two files (AFAIK). Have you got an stderr redirect that sends all postmaster output on stderr to your own log file? If so, set silent mode on the log configuration in your postgresql.conf to get the same effect - only it will appear in the main postgresql log file defined by log_filename. > > I guess I don't understand the meaning of these two different logging > destination. > > > Moreover, I'm catching the error stream in a perl application to log > errors: > > $sth = $dbh->prepare( "select ..." ); > $sth->execute ()|| > print (STDERR "PG error:" . $sth->errstr ."\n") && exit 1; > $sth->finish; > > Will I still get the postgres error in perl if I set redirect_stderr = > on in postgresql.conf ? Setting "redirect_stderr = on" will mean that all errors that would normally appear on the console that started the Postmaster will be sent to log_filename instead.. -- Andy Shellam NetServe Support Team the Mail Network "an alternative in a standardised world"