pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
entries in serverlog file
7+ messages / 4 participants
[nested] [flat]

* entries in serverlog file
@ 2007-08-09 21:37 Tena Sakai <tsakai@gallo.ucsf.edu>
  2007-08-09 21:44 ` Re: entries in serverlog file Joshua D. Drake <jd@commandprompt.com>
  2007-08-09 21:52 ` Re: entries in serverlog file Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 2 replies; 7+ messages in thread

From: Tena Sakai @ 2007-08-09 21:37 UTC (permalink / raw)
  To: pgsql-admin

Hi everybody,

I have, by default, on a linux machine, a file called
serverlog in the data directory, whose entries often
prove to be very useful.  What would be even more useful
would be a timestamp along with each entry.

Is there any way I can add such timestamp at this point?
Perhaps via postgresql.conf file (also in the data directory)?

Thank you in advance.

Regards,

Tena Sakai
tsakai@gallo.ucsf.edu

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: entries in serverlog file
  2007-08-09 21:37 entries in serverlog file Tena Sakai <tsakai@gallo.ucsf.edu>
@ 2007-08-09 21:44 ` Joshua D. Drake <jd@commandprompt.com>
  2007-08-09 23:20   ` Re: entries in serverlog file Tena Sakai <tsakai@gallo.ucsf.edu>
  2007-08-13 19:00   ` Re: entries in serverlog file Tena Sakai <tsakai@gallo.ucsf.edu>
  1 sibling, 2 replies; 7+ messages in thread

From: Joshua D. Drake @ 2007-08-09 21:44 UTC (permalink / raw)
  To: Tena Sakai <tsakai@gallo.ucsf.edu>; +Cc: pgsql-admin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tena Sakai wrote:
> Hi everybody,
> 
> I have, by default, on a linux machine, a file called
> serverlog in the data directory, whose entries often
> prove to be very useful.  What would be even more useful
> would be a timestamp along with each entry.
> 
> Is there any way I can add such timestamp at this point?
> Perhaps via postgresql.conf file (also in the data directory)?
> 
> Thank you in advance.

http://www.postgresql.org/docs/current/interactive/runtime-config-logging.html

>
> Regards,
> 
> Tena Sakai
> tsakai@gallo.ucsf.edu
> 


- --

      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
             http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGu4q7ATb/zqfZUUQRAgzrAJ9yatkzIfZgj7TxmhbaWigehhPVEQCfZoVO
n6Y80pi9LtTd9nvfd4rEeFw=
=zPj9
-----END PGP SIGNATURE-----



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: entries in serverlog file
  2007-08-09 21:37 entries in serverlog file Tena Sakai <tsakai@gallo.ucsf.edu>
  2007-08-09 21:44 ` Re: entries in serverlog file Joshua D. Drake <jd@commandprompt.com>
@ 2007-08-09 23:20   ` Tena Sakai <tsakai@gallo.ucsf.edu>
  1 sibling, 0 replies; 7+ messages in thread

From: Tena Sakai @ 2007-08-09 23:20 UTC (permalink / raw)
  To: Joshua D. Drake <jd@commandprompt.com>; Kevin.Grittner@wicourts.gov; +Cc: pgsql-admin

Hi Joshua,
Hi Kevin,

Many thanks for your suggestions/advices.
I am reading chapter 17 of the manual, which in the hindsight,
I should have read a month ago.  But this is very good.  I am
making haste slowly.

Thanks again.

Regards,

Tena Sakai
tsakai@gallo.ucsf.edu


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
From Kevin Grittner [Kevin.Grittner@wicourts.gov]

By all means, do read the documentation referred to by Joshua.

For a quick starting point, we have found it useful to use
these settings:

redirect_stderr = on
log_line_prefix = '[%m] %p %q<%u %d %r> '

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

-----Original Message-----
From: Joshua D. Drake [mailto:jd@commandprompt.com]
Sent: Thu 8/9/2007 2:44 PM
To: Tena Sakai
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] entries in serverlog file
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tena Sakai wrote:
> Hi everybody,
> 
> I have, by default, on a linux machine, a file called
> serverlog in the data directory, whose entries often
> prove to be very useful.  What would be even more useful
> would be a timestamp along with each entry.
> 
> Is there any way I can add such timestamp at this point?
> Perhaps via postgresql.conf file (also in the data directory)?
> 
> Thank you in advance.

http://www.postgresql.org/docs/current/interactive/runtime-config-logging.html

>
> Regards,
> 
> Tena Sakai
> tsakai@gallo.ucsf.edu
> 


- --

      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
             http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGu4q7ATb/zqfZUUQRAgzrAJ9yatkzIfZgj7TxmhbaWigehhPVEQCfZoVO
n6Y80pi9LtTd9nvfd4rEeFw=
=zPj9
-----END PGP SIGNATURE-----

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: entries in serverlog file
  2007-08-09 21:37 entries in serverlog file Tena Sakai <tsakai@gallo.ucsf.edu>
  2007-08-09 21:44 ` Re: entries in serverlog file Joshua D. Drake <jd@commandprompt.com>
@ 2007-08-13 19:00   ` Tena Sakai <tsakai@gallo.ucsf.edu>
  2007-08-13 19:42     ` Re: entries in serverlog file Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 7+ messages in thread

From: Tena Sakai @ 2007-08-13 19:00 UTC (permalink / raw)
  To: Joshua D. Drake <jd@commandprompt.com>; +Cc: pgsql-admin

Hi Everybody,

I have read chapter 17 of the current manual and learned
interesting options.  But as I compare what's in the
postgresql.conf file to what I think I comprehend, I am
a slightly confused:

In the conf file I see log_destination is set as 'stderr'
and redirect_stderr is set as off AND they are both commented
out.  Yet, I am accumulating log entries into serverlog file.
To me this is a fine default setting.  So my question amounts
to be the following:

Can I just uncomment log_line_prefix entry and stick what I want
(such as %u, %d, %m, etc) into the quotes and expect to see the
logged lines be prefixed with username, database name, timestamp,
etc with all other things intact?  I come from change-as-few-
things-as-possible-at-one-time-school.

Thank you in advance.

Regards,

Tena Sakai
tsakai@gallo.ucsf.edu
 


-----Original Message-----
From: Joshua D. Drake [mailto:jd@commandprompt.com]
Sent: Thu 8/9/2007 2:44 PM
To: Tena Sakai
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] entries in serverlog file
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tena Sakai wrote:
> Hi everybody,
> 
> I have, by default, on a linux machine, a file called
> serverlog in the data directory, whose entries often
> prove to be very useful.  What would be even more useful
> would be a timestamp along with each entry.
> 
> Is there any way I can add such timestamp at this point?
> Perhaps via postgresql.conf file (also in the data directory)?
> 
> Thank you in advance.

http://www.postgresql.org/docs/current/interactive/runtime-config-logging.html

>
> Regards,
> 
> Tena Sakai
> tsakai@gallo.ucsf.edu
> 


- --

      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
             http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGu4q7ATb/zqfZUUQRAgzrAJ9yatkzIfZgj7TxmhbaWigehhPVEQCfZoVO
n6Y80pi9LtTd9nvfd4rEeFw=
=zPj9
-----END PGP SIGNATURE-----

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: entries in serverlog file
  2007-08-09 21:37 entries in serverlog file Tena Sakai <tsakai@gallo.ucsf.edu>
  2007-08-09 21:44 ` Re: entries in serverlog file Joshua D. Drake <jd@commandprompt.com>
  2007-08-13 19:00   ` Re: entries in serverlog file Tena Sakai <tsakai@gallo.ucsf.edu>
@ 2007-08-13 19:42     ` Tom Lane <tgl@sss.pgh.pa.us>
  2007-08-13 19:52       ` Re: entries in serverlog file Tena Sakai <tsakai@gallo.ucsf.edu>
  0 siblings, 1 reply; 7+ messages in thread

From: Tom Lane @ 2007-08-13 19:42 UTC (permalink / raw)
  To: Tena Sakai <tsakai@gallo.ucsf.edu>; +Cc: Joshua D. Drake <jd@commandprompt.com>; pgsql-admin

"Tena Sakai" <tsakai@gallo.ucsf.edu> writes:
> Can I just uncomment log_line_prefix entry and stick what I want
> (such as %u, %d, %m, etc) into the quotes and expect to see the
> logged lines be prefixed with username, database name, timestamp,
> etc with all other things intact?

Sure; you will however regret by and by that you didn't turn on
redirect_stderr, because there is no way to rotate the logfile
(other than restarting the postmaster) when it's simply going straight
to stderr.  The more verbose you make the log, the sooner its bulk is
going to become a problem...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: entries in serverlog file
  2007-08-09 21:37 entries in serverlog file Tena Sakai <tsakai@gallo.ucsf.edu>
  2007-08-09 21:44 ` Re: entries in serverlog file Joshua D. Drake <jd@commandprompt.com>
  2007-08-13 19:00   ` Re: entries in serverlog file Tena Sakai <tsakai@gallo.ucsf.edu>
  2007-08-13 19:42     ` Re: entries in serverlog file Tom Lane <tgl@sss.pgh.pa.us>
@ 2007-08-13 19:52       ` Tena Sakai <tsakai@gallo.ucsf.edu>
  0 siblings, 0 replies; 7+ messages in thread

From: Tena Sakai @ 2007-08-13 19:52 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Joshua D. Drake <jd@commandprompt.com>; pgsql-admin

Hi Tom,

Thanks.  I will live a bit dangerously while I
strategize what to do with the logfile.  I am
not sure if 7 day log rotation is really a
wise option for now.  I will come up with
something fitting in time.  Thanks for your
comment, nonetheless.

Regards,

Tena Sakai
tsakai@gallo.ucsf.edu


-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Mon 8/13/2007 12:42 PM
To: Tena Sakai
Cc: Joshua D. Drake; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] entries in serverlog file 
 
"Tena Sakai" <tsakai@gallo.ucsf.edu> writes:
> Can I just uncomment log_line_prefix entry and stick what I want
> (such as %u, %d, %m, etc) into the quotes and expect to see the
> logged lines be prefixed with username, database name, timestamp,
> etc with all other things intact?

Sure; you will however regret by and by that you didn't turn on
redirect_stderr, because there is no way to rotate the logfile
(other than restarting the postmaster) when it's simply going straight
to stderr.  The more verbose you make the log, the sooner its bulk is
going to become a problem...

			regards, tom lane

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: entries in serverlog file
  2007-08-09 21:37 entries in serverlog file Tena Sakai <tsakai@gallo.ucsf.edu>
@ 2007-08-09 21:52 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
  1 sibling, 0 replies; 7+ messages in thread

From: Kevin Grittner @ 2007-08-09 21:52 UTC (permalink / raw)
  To: Tena Sakai <tsakai@gallo.ucsf.edu>; pgsql-admin

>>> On Thu, Aug 9, 2007 at  4:37 PM, in message
<FE44E0D7EAD2ED4BB2165071DB8E328C03062B24@egcrc-ex01.egcrc.org>, "Tena Sakai"
<tsakai@gallo.ucsf.edu> wrote: 
> I have, by default, on a linux machine, a file called
> serverlog in the data directory, whose entries often
> prove to be very useful.  What would be even more useful
> would be a timestamp along with each entry.
> 
> Is there any way I can add such timestamp at this point?
> Perhaps via postgresql.conf file (also in the data directory)?
 
By all means, do read the documentation referred to by Joshua.
 
For a quick starting point, we have found it useful to use
these settings:
 
redirect_stderr = on
log_line_prefix = '[%m] %p %q<%u %d %r> '
 





^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2007-08-13 19:52 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-08-09 21:37 entries in serverlog file Tena Sakai <tsakai@gallo.ucsf.edu>
2007-08-09 21:44 ` Joshua D. Drake <jd@commandprompt.com>
2007-08-09 23:20   ` Tena Sakai <tsakai@gallo.ucsf.edu>
2007-08-13 19:00   ` Tena Sakai <tsakai@gallo.ucsf.edu>
2007-08-13 19:42     ` Tom Lane <tgl@sss.pgh.pa.us>
2007-08-13 19:52       ` Tena Sakai <tsakai@gallo.ucsf.edu>
2007-08-09 21:52 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox