Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 18173B615CA for ; Wed, 1 Jun 2011 14:17:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 23730-02 for ; Wed, 1 Jun 2011 17:17:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from locust.cns.vt.edu (locust.cns.vt.edu [198.82.169.14]) by mail.postgresql.org (Postfix) with ESMTP id D6285B612B3 for ; Wed, 1 Jun 2011 14:17:45 -0300 (ADT) Received: by locust.cns.vt.edu (Postfix, from userid 986) id 43CB2118A62; Wed, 1 Jun 2011 13:17:45 -0400 (EDT) Date: Wed, 1 Jun 2011 13:17:45 -0400 From: Ray Stell To: "Campbell, Lance" Cc: "pgsql-admin@postgresql.org" Subject: Re: logging how to add timestamp Message-ID: <20110601171745.GA3027@cns.vt.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/8 X-Sequence-Number: 37634 On Wed, Jun 01, 2011 at 04:56:12PM +0000, Campbell, Lance wrote: > Postgresql: 8.4.x > How do you add a timestamp to the logs. Currently I see: > > ERROR: {some error message} > STATEMENT: {the sql statement} > > Ideally I would like to have the timestamp in front of the statements. > > Thanks, > > Lance Campbell > Software Architect/Project Manager/DBA > Web Services at Public Affairs > 217.333.0382 > http://illinois.edu/toolbox > log_line_prefix # %t = timestamp (no milliseconds) # %m = timestamp with milliseconds