Additional startup logging

Started by Kevin Grittnerover 15 years ago3 messages
#1Kevin Grittner
Kevin.Grittner@wicourts.gov

It seems potentially useful to LOG the version() string in the log
file during startup. It might also help to LOG any settings which
might result in the loss of committed transactions or in database
corruption during startup. (After a crash, the postgresql.conf file
might not show the values which were in effect during startup, and
it is too late to "show" the values.)

-Kevin

#2Takahiro Itagaki
itagaki.takahiro@oss.ntt.co.jp
In reply to: Kevin Grittner (#1)
Re: Additional startup logging

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> wrote:

It seems potentially useful to LOG the version() string in the log
file during startup. It might also help to LOG any settings which
might result in the loss of committed transactions or in database
corruption during startup. (After a crash, the postgresql.conf file
might not show the values which were in effect during startup, and
it is too late to "show" the values.)

I think such logs depends on purposes, so they should be customizable.

You could write a module, that is registered in 'shared_preload_libraries'
and logs internal information you want from _PG_init() or shmem_startup_hook.

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center

#3Michael Glaesemann
grzm@seespotcode.net
In reply to: Takahiro Itagaki (#2)
Re: Additional startup logging

On Jun 30, 2010, at 22:43 , Takahiro Itagaki wrote:

"Kevin Grittner" <Kevin.Grittner@wicourts.gov> wrote:

It seems potentially useful to LOG the version() string in the log
file during startup. It might also help to LOG any settings which
might result in the loss of committed transactions or in database
corruption during startup. (After a crash, the postgresql.conf file
might not show the values which were in effect during startup, and
it is too late to "show" the values.)

I think such logs depends on purposes, so they should be customizable.

You could write a module, that is registered in 'shared_preload_libraries'
and logs internal information you want from _PG_init() or shmem_startup_hook.

For long-running systems, you may not have the beginning of the log file. Perhaps a method of dumping the version and/or setting information on demand (or perhaps at the beginning of each log file?): Shouldn't be too hard to put together a function which prints out such information via RAISE even now using PL/pgSQL.

Michael Glaesemann
grzm seespotcode net