Postgres log help - Postgresql-8.3.5
--000e0cd11252ae2a8c047f6cc514
Content-Type: text/plain; charset=ISO-8859-1
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 <unnamed>: select count(*) from v_mthly_demo_rollup
LOG: duration: 211.724 ms
LOG: duration: 0.499 ms
LOG: duration: 0.082 ms
LOG: execute <unnamed>: 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(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(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(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(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
--000e0cd11252ae2a8c047f6cc514
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi All,=A0<div><br></div><div>I am not able to figure out how to change the=
logging to a single line,</div><div><br></div><div><b>My log file out puts=
</b></div><div><br></div><div><div>LOG: =A0duration: 0.492 ms</div><div>LOG=
: =A0duration: 0.397 ms</div>
<div>LOG: =A0duration: 0.097 ms</div><div>LOG: =A0execute <unnamed>: =
select count(*) from v_mthly_demo_rollup</div><div>LOG: =A0duration: 211.72=
4 ms</div><div>LOG: =A0duration: 0.499 ms</div><div>LOG: =A0duration: 0.082=
ms</div>
<div>LOG: =A0execute <unnamed>: select count(*) from v_mthly__demo_ro=
llup where (demo_nm=3D'test' AND rollup_eff_yr_mth=3D'200912=
9;)</div><div>LOG: =A0duration: 0.544 ms</div><div>LOG: =A0duration: 0.334 =
ms</div>
<div>LOG: =A0duration: 0.036 ms</div><div><br></div><div><b>I want my log f=
ile to output something like in the below format</b></div><div><b><br></b><=
/div><div><div>2010-02-12 11:01:48 PST|usr|dbdemo|<a href=3D"http://server-=
res0003.net">server-res0003.net</a>(45872)|11683|2010-02-12 11:01:48.630 PS=
T|SELECT|4b72f31d.2da3|8709|2010-02-10 09:55:41 PST|0LOG: =A0duration: 0.09=
9 ms</div>
<div>2010-02-12 11:01:48 PST|usr|dbdemo|<a href=3D"http://server-res0003.ne=
t">server-res0003.net</a>(45872)|11683|2010-02-12 11:01:48.630 PST|BIND|4b7=
2f31d.2da3|8710|2010-02-10 09:55:41 PST|0LOG: =A0duration: 0.011 ms</div><d=
iv>
<br></div><div>Here is my postgresql.conf file log configuration informatio=
n</div><div><br></div><div><div># ERROR REPORTING AND LOGGING</div><div>#--=
------------------------------------------------------------ ---------------=
-</div>
<div><br></div><div># - Where to Log -</div><div><br></div><div>logging_col=
lector =3D on =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# changed on 04/07/2009</d=
iv><div>log_directory =3D '/db_log/demo/pgsql8.3.5/pg_log' =A0 =A0 =
=A0 =A0 =A0# changed on 04/07/2009</div>
<div>log_filename =3D 'postgresql-v8.3.5-%Y-%m-%d_%H%M%S.log' =A0 =
=A0# =A0changed on 04/07/2009</div><div>log_truncate_on_rotation =3D on =A0=
=A0 =A0 =A0 =A0 # changed on 04/07/2009</div><div>log_rotation_age =3D 1d =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Automatic rotation of logfiles will</=
div>
<div>log_rotation_size =3D 100MB =A0 =A0 =A0 =A0 =A0 =A0 =A0 # changed on 0=
4/07/2009</div><div>log_line_prefix =3D '%u|%d|%r|%p|%t|%m|%i|%c|%l|%s|=
%x' # changes done on 05/15/2009 =A0:</div><div>log_checkpoints =3D on<=
/div><div>log_connections =3D on</div>
<div>log_disconnections =3D on</div><div>log_duration =3D on</div><div>log_=
hostname =3D on</div><div>log_line_prefix =3D '' =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 # special values:</div><div>log_lock_waits =3D on =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 #changed on 04/07/2009</div>
<div>log_statement =3D 'all' =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # =
changed below 6 lines on 04/07/2009</div><div>#----------------------------=
--------------------------------------------------</div><div><br></div><div=
>Which parameter should I need to change to output in my log in the below f=
ormat</div>
<div><div>2010-02-12 11:01:48 PST|usr|dbdemo|<a href=3D"http://server-res00=
03.net">server-res0003.net</a>(45872)|11683|2010-02-12 11:01:48.630 PST|SEL=
ECT|4b72f31d.2da3|8709|2010-02-10 09:55:41 PST|0LOG: =A0duration: 0.099 ms<=
/div>
<div>2010-02-12 11:01:48 PST|usr|dbdemo|<a href=3D"http://server-res0003.ne=
t">server-res0003.net</a>(45872)|11683|2010-02-12 11:01:48.630 PST|BIND|4b7=
2f31d.2da3|8710|2010-02-10 09:55:41 PST|0LOG: =A0duration: 0.011 ms</div></=
div>
<div><br></div><div>Thanks</div><div>Deepak</div></div></div></div>
--000e0cd11252ae2a8c047f6cc514--
Re: Postgres log help - Postgresql-8.3.5
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 <unnamed>: select count(*) from v_mthly_demo_rollup
> LOG: duration: 211.724 ms
> LOG: duration: 0.499 ms
> LOG: duration: 0.082 ms
> LOG: execute <unnamed>: 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
--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Re: Postgres log help - Postgresql-8.3.5
--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 <lkapell [at] setonhome.org>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 <unnamed>: select count(*) from v_mthly_demo_rollup
>> LOG: duration: 211.724 ms
>> LOG: duration: 0.499 ms
>> LOG: duration: 0.082 ms
>> LOG: execute <unnamed>: 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
<div>Thank you for your answer.</div><div>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'</div><div>and another log_li=
ne_prefix =3D '' (end of the file)</div>
<div><br></div><div>Its working now..</div><div><br></div><div>thanks</div>=
<div>Deepak</div><div><br><div class=3D"gmail_quote">On Fri, Feb 12, 2010 a=
t 12:53 PM, Lewis Kapell <span dir=3D"ltr"><<a href=3D"mailto:lkapell [at] se=
tonhome.org">lkapell [at] setonhome.org</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;">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?<br>
<br>
If you issue the following within a psql session, it will tell you what con=
fig value the server is currently using:<br>
<br>
=A0 =A0 =A0 =A0show log_line_prefix;<br>
<br>
Looks like either your server hasn't reloaded the updated config file, =
or you edited the wrong config file.<br>
<br>
Lewis<br>
<br>
<br>
DM wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im">
Hi All, <br>
I am not able to figure out how to change the logging to a single line,<br>
<br>
*My log file out puts*<br>
<br>
LOG: =A0duration: 0.492 ms<br>
LOG: =A0duration: 0.397 ms<br>
LOG: =A0duration: 0.097 ms<br>
LOG: =A0execute <unnamed>: select count(*) from v_mthly_demo_rollup<b=
r>
LOG: =A0duration: 211.724 ms<br>
LOG: =A0duration: 0.499 ms<br>
LOG: =A0duration: 0.082 ms<br>
LOG: =A0execute <unnamed>: select count(*) from v_mthly__demo_rollup =
where (demo_nm=3D'test' AND rollup_eff_yr_mth=3D'200912')<b=
r>
LOG: =A0duration: 0.544 ms<br>
LOG: =A0duration: 0.334 ms<br>
LOG: =A0duration: 0.036 ms<br>
<br>
*I want my log file to output something like in the below format*<br>
*<br>
*<br></div>
2010-02-12 11:01:48 PST|usr|dbdemo|<a href=3D"http://server-res0003.net" ta=
rget=3D"_blank">server-res0003.net</a> <<a href=3D"http://server-res0003=
..net" target=3D"_blank">http://server-res0003.net</a>>(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<br>
2010-02-12 11:01:48 PST|usr|dbdemo|<a href=3D"http://server-res0003.net" ta=
rget=3D"_blank">server-res0003.net</a> <<a href=3D"http://server-res0003=
..net" target=3D"_blank">http://server-res0003.net</a>>(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<div class=3D"im">
<br>
<br>
Here is my postgresql.conf file log configuration information<br>
<br>
# ERROR REPORTING AND LOGGING<br>
#----------------------------------------------------------- ---------------=
----<br>
<br>
# - Where to Log -<br>
<br>
logging_collector =3D on =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# changed on 04=
/07/2009<br>
log_directory =3D '/db_log/demo/pgsql8.3.5/pg_log' =A0 =A0 =A0 =A0 =
=A0# changed on 04/07/2009<br>
log_filename =3D 'postgresql-v8.3.5-%Y-%m-%d_%H%M%S.log' =A0 =A0# =
=A0changed on 04/07/2009<br>
log_truncate_on_rotation =3D on =A0 =A0 =A0 =A0 =A0 # changed on 04/07/2009=
<br>
log_rotation_age =3D 1d =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Automatic rot=
ation of logfiles will<br>
log_rotation_size =3D 100MB =A0 =A0 =A0 =A0 =A0 =A0 =A0 # changed on 04/07/=
2009<br>
log_line_prefix =3D '%u|%d|%r|%p|%t|%m|%i|%c|%l|%s|%x' # changes do=
ne on 05/15/2009 =A0:<br>
log_checkpoints =3D on<br>
log_connections =3D on<br>
log_disconnections =3D on<br>
log_duration =3D on<br>
log_hostname =3D on<br>
log_line_prefix =3D '' =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # specia=
l values:<br>
log_lock_waits =3D on =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 #changed on 0=
4/07/2009<br>
log_statement =3D 'all' =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # chang=
ed below 6 lines on 04/07/2009<br>
#----------------------------------------------------------- ---------------=
----<br>
<br>
Which parameter should I need to change to output in my log in the below fo=
rmat<br></div>
2010-02-12 11:01:48 PST|usr|dbdemo|<a href=3D"http://server-res0003.net" ta=
rget=3D"_blank">server-res0003.net</a> <<a href=3D"http://server-res0003=
..net" target=3D"_blank">http://server-res0003.net</a>>(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<br>
2010-02-12 11:01:48 PST|usr|dbdemo|<a href=3D"http://server-res0003.net" ta=
rget=3D"_blank">server-res0003.net</a> <<a href=3D"http://server-res0003=
..net" target=3D"_blank">http://server-res0003.net</a>>(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<br>
<br>
Thanks<br>
Deepak<br>
</blockquote>
<br>
</blockquote></div><br></div>
--000325560d9264ccba047f6e2fa8--