"Michael Charnoky" <[EMAIL PROTECTED]> writes: > If PostgreSQL fails to start (eg: the OS's SHMMAX wasn't set high enough to > handle the requested 'shared_buffers'), the error message gets logged to > stderr only and not the logfile in 'log_directory'. I would like to simply > redirect stderr to /dev/null and just rely on the logfiles, but am worried > that I might miss some error messages.
Sorry, this request is hopeless. While we could possibly start redirecting a bit earlier than we do now, that wouldn't eliminate the basic problem. There will *always* be some startup-time messages that are vulnerable to this problem --- what if startup fails before it can fork the log collector and redirect stderr, or even before it can read the configuration file to find out it is supposed to redirect? A good scheme is to use redirect_stderr, but also have the postmaster's original stdout/stderr directed to a backup log file. You need not worry about rotation of the backup log file, since it isn't expected to accumulate much data, but it needs to be there to backstop the log collector for startup problems and failures of the log collector itself. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate