X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 97BA8536A1 for ; Wed, 30 Mar 2005 21:00:05 +0100 (BST) 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 21496-08 for ; Wed, 30 Mar 2005 20:00:01 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.206]) by svr1.postgresql.org (Postfix) with ESMTP id 4065653435 for ; Wed, 30 Mar 2005 21:00:00 +0100 (BST) Received: by wproxy.gmail.com with SMTP id 68so305498wra for ; Wed, 30 Mar 2005 12:00:01 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=upYf5Aemd/PH7vG6XbeI6tum0DCqm/VEfgLI8ZDKR/q5gju5l9fifsnHtMUKkXqL8mW6o1tlwhc4IPXyOxrpWnjTQfN05kdiiFrs+gpsY5cl2gWrM7mMvZdXx9wyxDdldBw/9UlYPqiXEyPKSppWCOehbyJh6+m/GabIg9288cE= Received: by 10.54.14.10 with SMTP id 10mr524769wrn; Wed, 30 Mar 2005 12:00:01 -0800 (PST) Received: by 10.54.56.6 with HTTP; Wed, 30 Mar 2005 12:00:01 -0800 (PST) Message-ID: <11c11fe05033012006b91fa95@mail.gmail.com> Date: Wed, 30 Mar 2005 14:00:01 -0600 From: Steven Erickson Reply-To: Steven Erickson To: pgsql-admin@postgresql.org Subject: Logging question Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200503/495 X-Sequence-Number: 16993 Because of customer requirements, I need to log all database modifying SQL, including the data itself, to a text file. This file will be protected to prevent all but a small, select number of users from viewing because of the secure nature of the data. They also want postgres status messages (startup, shutdown, non-sql errors) to be logged in syslog. Is there a way to configure postgresql.conf to do this? As I see it, postgresql.conf can be set to log to syslog and stderr, where stderr can be redirected to some other location. However, the entries will be the same. Is the only solution to log only to syslog, and only for errors, and put the SQL logging in the application? Or, can a stored procedure be called by a 'trigger after' that could write the SQL to a flat file?