Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id CEFD663285F for ; Fri, 12 Feb 2010 17:45:37 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 28483-02 for ; Fri, 12 Feb 2010 21:45:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f175.google.com (mail-pz0-f175.google.com [209.85.222.175]) by mail.postgresql.org (Postfix) with ESMTP id 0694B6326D5 for ; Fri, 12 Feb 2010 17:45:26 -0400 (AST) Received: by pzk5 with SMTP id 5so4472237pzk.29 for ; Fri, 12 Feb 2010 13:45:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=cDcyurPv2b7yBXksaq4PZ3kBEPpelqf2cN442AWM8Hc=; b=beYQ1lLlQEhO6+21+uFEsCDZXbtXElIa0TN0KAvh1I2ECPYM7/5jCaP91Z5N5A8mL+ LgLtYpzDMJAdKmEB2zrSioLY6R7dhjODLEeu+neiI4ZU0fKfK4fxNdJPbNs11ZIuEoTl CTyrRwPRheJrfhDTd8O5pvRvWATV/MWFgH4xc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Z24gTgALPwx7Ou+u2auuD8lJstm7TK8g8/Sur3FScYuIjmD8ksbFVofa4amtFt1Caq FBpr5C0+fcP15Wzlg4s2K7ro9dVSSK4u2O39bU3qnPwOCl2J8S7GpTHqjwFbCC5KYSUF pPN5btPU2QyumK2MErN0Khu/VArWZxkX+pwMI= MIME-Version: 1.0 Received: by 10.141.124.15 with SMTP id b15mr1339601rvn.135.1266011125107; Fri, 12 Feb 2010 13:45:25 -0800 (PST) In-Reply-To: <4B75BFD6.8050701@setonhome.org> References: <4B75BFD6.8050701@setonhome.org> Date: Fri, 12 Feb 2010 13:45:25 -0800 Message-ID: Subject: Re: Postgres log help - Postgresql-8.3.5 From: DM To: Lewis Kapell Cc: pgsql-admin@postgresql.org Content-Type: multipart/alternative; boundary=000325560d9264ccba047f6e2fa8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201002/115 X-Sequence-Number: 33718 --000325560d9264ccba047f6e2fa8 Content-Type: text/plain; charset=ISO-8859-1 Thank you for your answer. I had made a mistake in my postgresql.conf having 2 entries for log_line_prefix one with log_line_prefix = '%t|%u|%d|%r|%p|%m|%i|%c|%l|%s|%x' and another log_line_prefix = '' (end of the file) Its working now.. thanks Deepak On Fri, Feb 12, 2010 at 12:53 PM, Lewis Kapell wrote: > Did you issue the reload command using pg_ctl after editing your > postgresql.conf, to tell the server to pick up the changes? > > If you issue the following within a psql session, it will tell you what > config value the server is currently using: > > show log_line_prefix; > > Looks like either your server hasn't reloaded the updated config file, or > you edited the wrong config file. > > Lewis > > > DM wrote: > >> Hi All, >> I am not able to figure out how to change the logging to a single line, >> >> *My log file out puts* >> >> LOG: duration: 0.492 ms >> LOG: duration: 0.397 ms >> LOG: duration: 0.097 ms >> LOG: execute : select count(*) from v_mthly_demo_rollup >> LOG: duration: 211.724 ms >> LOG: duration: 0.499 ms >> LOG: duration: 0.082 ms >> LOG: execute : select count(*) from v_mthly__demo_rollup where >> (demo_nm='test' AND rollup_eff_yr_mth='200912') >> LOG: duration: 0.544 ms >> LOG: duration: 0.334 ms >> LOG: duration: 0.036 ms >> >> *I want my log file to output something like in the below format* >> * >> * >> 2010-02-12 11:01:48 PST|usr|dbdemo|server-res0003.net < >> http://server-res0003.net>(45872)|11683|2010-02-12 11:01:48.630 >> PST|SELECT|4b72f31d.2da3|8709|2010-02-10 09:55:41 PST|0LOG: duration: 0.099 >> ms >> 2010-02-12 11:01:48 PST|usr|dbdemo|server-res0003.net < >> http://server-res0003.net>(45872)|11683|2010-02-12 11:01:48.630 >> PST|BIND|4b72f31d.2da3|8710|2010-02-10 09:55:41 PST|0LOG: duration: 0.011 >> ms >> >> >> Here is my postgresql.conf file log configuration information >> >> # ERROR REPORTING AND LOGGING >> >> #------------------------------------------------------------------------------ >> >> # - Where to Log - >> >> logging_collector = on # changed on 04/07/2009 >> log_directory = '/db_log/demo/pgsql8.3.5/pg_log' # changed on >> 04/07/2009 >> log_filename = 'postgresql-v8.3.5-%Y-%m-%d_%H%M%S.log' # changed on >> 04/07/2009 >> log_truncate_on_rotation = on # changed on 04/07/2009 >> log_rotation_age = 1d # Automatic rotation of logfiles >> will >> log_rotation_size = 100MB # changed on 04/07/2009 >> log_line_prefix = '%u|%d|%r|%p|%t|%m|%i|%c|%l|%s|%x' # changes done on >> 05/15/2009 : >> log_checkpoints = on >> log_connections = on >> log_disconnections = on >> log_duration = on >> log_hostname = on >> log_line_prefix = '' # special values: >> log_lock_waits = on #changed on 04/07/2009 >> log_statement = 'all' # changed below 6 lines on >> 04/07/2009 >> >> #------------------------------------------------------------------------------ >> >> Which parameter should I need to change to output in my log in the below >> format >> 2010-02-12 11:01:48 PST|usr|dbdemo|server-res0003.net < >> http://server-res0003.net>(45872)|11683|2010-02-12 11:01:48.630 >> PST|SELECT|4b72f31d.2da3|8709|2010-02-10 09:55:41 PST|0LOG: duration: 0.099 >> ms >> 2010-02-12 11:01:48 PST|usr|dbdemo|server-res0003.net < >> http://server-res0003.net>(45872)|11683|2010-02-12 11:01:48.630 >> PST|BIND|4b72f31d.2da3|8710|2010-02-10 09:55:41 PST|0LOG: duration: 0.011 >> ms >> >> Thanks >> Deepak >> > > --000325560d9264ccba047f6e2fa8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thank you for your answer.
I had made a mistake in my postgr= esql.conf having 2 entries for log_line_prefix one with =A0log_line_prefix = =3D '%t|%u|%d|%r|%p|%m|%i|%c|%l|%s|%x'
and another log_li= ne_prefix =3D '' (end of the file)

Its working now..

thanks
=
Deepak

On Fri, Feb 12, 2010 a= t 12:53 PM, Lewis Kapell <lkapell@setonhome.org> wrote:
Did you issue the reload command using pg_c= tl after editing your postgresql.conf, to tell the server to pick up the ch= anges?

If you issue the following within a psql session, it will tell you what con= fig value the server is currently using:

=A0 =A0 =A0 =A0show log_line_prefix;

Looks like either your server hasn't reloaded the updated config file, = or you edited the wrong config file.

Lewis


DM wrote:
Hi All,
I am not able to figure out how to change the logging to a single line,

*My log file out puts*

LOG: =A0duration: 0.492 ms
LOG: =A0duration: 0.397 ms
LOG: =A0duration: 0.097 ms
LOG: =A0execute <unnamed>: select count(*) from v_mthly_demo_rollup LOG: =A0duration: 211.724 ms
LOG: =A0duration: 0.499 ms
LOG: =A0duration: 0.082 ms
LOG: =A0execute <unnamed>: select count(*) from v_mthly__demo_rollup = where (demo_nm=3D'test' AND rollup_eff_yr_mth=3D'200912') LOG: =A0duration: 0.544 ms
LOG: =A0duration: 0.334 ms
LOG: =A0duration: 0.036 ms

*I want my log file to output something like in the below format*
*
*
2010-02-12 11:01:48 PST|usr|dbdemo|server-res0003.net <http://server-res0003.net>(45872)|11683|2010= -02-12 11:01:48.630 PST|SELECT|4b72f31d.2da3|8709|2010-02-10 09:55:41 PST|0= LOG: =A0duration: 0.099 ms
2010-02-12 11:01:48 PST|usr|dbdemo|server-res0003.net <http://server-res0003.net>(45872)|11683|2010= -02-12 11:01:48.630 PST|BIND|4b72f31d.2da3|8710|2010-02-10 09:55:41 PST|0LO= G: =A0duration: 0.011 ms


Here is my postgresql.conf file log configuration information

# ERROR REPORTING AND LOGGING
#--------------------------------------------------------------------------= ----

# - Where to Log -

logging_collector =3D on =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# changed on 04= /07/2009
log_directory =3D '/db_log/demo/pgsql8.3.5/pg_log' =A0 =A0 =A0 =A0 = =A0# changed on 04/07/2009
log_filename =3D 'postgresql-v8.3.5-%Y-%m-%d_%H%M%S.log' =A0 =A0# = =A0changed on 04/07/2009
log_truncate_on_rotation =3D on =A0 =A0 =A0 =A0 =A0 # changed on 04/07/2009=
log_rotation_age =3D 1d =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Automatic rot= ation of logfiles will
log_rotation_size =3D 100MB =A0 =A0 =A0 =A0 =A0 =A0 =A0 # changed on 04/07/= 2009
log_line_prefix =3D '%u|%d|%r|%p|%t|%m|%i|%c|%l|%s|%x' # changes do= ne on 05/15/2009 =A0:
log_checkpoints =3D on
log_connections =3D on
log_disconnections =3D on
log_duration =3D on
log_hostname =3D on
log_line_prefix =3D '' =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # specia= l values:
log_lock_waits =3D on =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 #changed on 0= 4/07/2009
log_statement =3D 'all' =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # chang= ed below 6 lines on 04/07/2009
#--------------------------------------------------------------------------= ----

Which parameter should I need to change to output in my log in the below fo= rmat
2010-02-12 11:01:48 PST|usr|dbdemo|server-res0003.net <http://server-res0003.net>(45872)|11683|2010= -02-12 11:01:48.630 PST|SELECT|4b72f31d.2da3|8709|2010-02-10 09:55:41 PST|0= LOG: =A0duration: 0.099 ms
2010-02-12 11:01:48 PST|usr|dbdemo|server-res0003.net <http://server-res0003.net>(45872)|11683|2010= -02-12 11:01:48.630 PST|BIND|4b72f31d.2da3|8710|2010-02-10 09:55:41 PST|0LO= G: =A0duration: 0.011 ms

Thanks
Deepak


--000325560d9264ccba047f6e2fa8--