Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 045EE9FA64B for ; Wed, 26 Sep 2007 13:38:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 04793-01-2 for ; Wed, 26 Sep 2007 13:38:27 -0300 (ADT) X-Greylist: delayed 00:21:52.255753 by SQLgrey-1.7.5 Received: from smtp132.iad.emailsrvr.com (smtp132.iad.emailsrvr.com [207.97.245.132]) by postgresql.org (Postfix) with ESMTP id C58D39FA636 for ; Wed, 26 Sep 2007 13:38:27 -0300 (ADT) Received: from intercastingcorp.com (webmail11.webmail.iad.mlsrvr.com [192.168.1.31]) by relay3.r3.iad.emailsrvr.com (SMTP Server) with ESMTP id BC95D45129D for ; Wed, 26 Sep 2007 12:16:33 -0400 (EDT) Received: by secure.webmail.us (Authenticated sender: scottb@intercastingcorp.com, from: scottb@intercastingcorp.com) with HTTP; Wed, 26 Sep 2007 09:16:33 -0700 (PDT) Message-ID: <48528.192.168.1.70.1190823393.webmail@192.168.1.70> Date: Wed, 26 Sep 2007 09:16:33 -0700 (PDT) Subject: log_duration / log_min_duration_statement differences between 8.1.8 and 8.2.4 From: scottb@intercastingcorp.com To: pgsql-admin@postgresql.org Reply-To: scottb@intercastingcorp.com X-Mailer: webmail 6.4 MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/150 X-Sequence-Number: 26911 Hi,=0A=0AWe're starting to migrate from postgres 8.1.8 to 8.2.4=0Aand notic= ing behavioral differences in what they log (via syslog to /var/log/pgsql)= =0A=0AThe behavior we have on 8.1.8 is:=0A* log all data-modification queri= es (with duration)=0A* log all queries that take longer than 1000 millisec = (with duration)=0A=0A=0AWe'd like to have that behavior on 8.2.x as well.= =0A=0AInstead we're getting:=0A* log all data-modification queries (with du= ration)=0A* log all queries that take longer than 1000 millisec (with durat= ion)=0A PLUS=0A* (unwanted) log durations only for fast, non-mod queries= =0Aexample:=0ASep 26 09:03:50 db02 postgres[3882]: [78-1] db=3Dour_db; user= =3Dapp_writer; host=3Da.b.c.d; LOG: duration: 0.030 ms=0A=0AWhen I set =0A= log_duration =3D off=0AI avoid the unwanted durations of fast SELECTs, = but also lose the durations of the data-modification queries.=0A=0A* log al= l data-modification queries ( WITHOUT duration)=0A* log all queries that= take longer than 1000 millisec (with duration)=0A=0A=0AAny suggestions ?= =0A=0A - scottb=0A=0A=0A=0A from our 8.1.8 postgresql.conf:=0A=0A#------= ---------------------------------------------------------------------=0A# E= RROR REPORTING AND LOGGING=0A#---------------------------------------------= ------------------------------=0A=0A# - Where to Log -=0Alog_destination = =3D 'syslog'=0Aredirect_stderr =3D off=0A=0A#silent_mode =3D off=0A=0A# The= se are relevant when logging to syslog:=0A#syslog_facility =3D 'LOCAL0'=0A#= syslog_ident =3D 'postgres'=0A=0A# - When to Log -=0Aclient_min_messages = =3D warning=0Alog_min_messages =3D warning=0Alog_error_verbosity =3D defaul= t=0Alog_min_error_statement =3D error=0Alog_min_duration_statement =3D 100= 0=0A=0A# - What to Log -=0A#debug_print_parse =3D off=0A#debug_print_rewrit= ten =3D off=0A#debug_print_plan =3D off=0A#debug_pretty_print =3D off=0A=0A= log_connections =3D on=0A#log_disconnections =3D off=0Alog_duration =3D on= =0Alog_line_prefix =3D 'db=3D%d; user=3D%u; host=3D%h; '=0A=0Alog_statement= =3D 'mod'=0A=0A=0A=0A from our postgres 8.2.4 postgresql.conf:=0A=0A#= ---------------------------------------------------------------------------= =0A# ERROR REPORTING AND LOGGING=0A#---------------------------------------= ------------------------------------=0A=0A# - Where to Log -=0Alog_destinat= ion =3D 'syslog'=0Aredirect_stderr =3D off=0A=0A#silent_mode =3D off=0A=0A#= These are relevant when logging to syslog:=0A#syslog_facility =3D 'LOCAL0'= =0A#syslog_ident =3D 'postgres'=0A=0A# - When to Log -=0Aclient_min_message= s =3D warning=0Alog_min_messages =3D warning=0Alog_error_verbosity =3D defa= ult=0Alog_min_error_statement =3D error=0Alog_min_duration_statement =3D 10= 00=0A=0A# - What to Log -=0A#debug_print_parse =3D off=0A#debug_print_rewri= tten =3D off=0A#debug_print_plan =3D off=0A#debug_pretty_print =3D off=0A= =0Alog_connections =3D on=0A#log_disconnections =3D off=0A=0A=0Alog_duratio= n =3D off ## logs just the queries we want (mod + slow), but without du= rations=0A## XOR=0Alog_duration =3D on ## logs the queries we want, w= ith durations, PLUS duration loglines for all the fast SELECTs=0A=0A=0Alog_= line_prefix =3D 'db=3D%d; user=3D%u; host=3D%h; '=0A=0Alog_statement =3D 'm= od'=0A