Skip site navigation (1) Skip section navigation (2)

fate of pg_logger (was Re: [PATCHES] Contrib modules on Win32)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgreSQL(dot)org, pgsql-hackers-win32(at)postgreSQL(dot)org
Subject: fate of pg_logger (was Re: [PATCHES] Contrib modules on Win32)
Date: 2004-09-13 22:13:13
Message-ID: 26831.1095113593@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32pgsql-patches
"Dave Page" <dpage(at)vale-housing(dot)co(dot)uk> writes:
>>> [ in list of contrib modules that don't build on Windows ]
>>> pg_logger

>> deprecated; use redirect_stderr (BTW, is it default on win32 now?)

> Yes, it's the default on Win32 (installer releases anyhoo). I take it
> this should be removed from /contrib then.

I looked into this a little.  pg_logger isn't directly replaced by the
redirect_stderr code, because it actually redirects stderr to syslog,
not straight into files.  It's reasonable that someone would want this
facility instead of elog.c's built-in support for syslog.  The original
motivation for the contrib module can be found in this thread:
  http://archives.postgresql.org/pgsql-hackers/2001-02/msg00295.php
where it was pointed out that backends sometimes emit messages to stderr
without going through elog(), and so the elog-based redirection to
syslog isn't very reliable.

That argument is a lot weaker than it was at the time, mainly because we
already waged the "holy war on stdout/stderr messages in the backend"
that I didn't want to get into in the above-cited message; we did so to
support localization and SQLSTATE codes for error messages.  There are
still a very few stderr prints in the backend, but AFAIK they are all
developer-only debug support.  The case of useful messages from dynamic
linker failures is the only argument that I think still has much weight,
and you could easily classify that one as a developer-only issue, too.

In any case, given the 8.0 code base, pg_logger makes no sense.
If you wanted the facility, what you'd do is put an additional option
into postmaster/syslogger.c to send captured output to syslog instead
of files.  That way you would have a logger that would be automatically
launched by the postmaster --- ergo, no need to tweak init scripts ---
and what's more would be re-launched by the postmaster should it chance
to die.

So I don't see any value in putting any work into contrib/pg_logger to
make it build (or suppress it from building) on Windows.  If I don't
hear a squawk PDQ, I'll remove the contrib module.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2004-09-13 22:36:16
Subject: Re: beta1 & beta2 & Windows & heavy load
Previous:From: Simon RiggsDate: 2004-09-13 22:07:37
Subject: Re: SELECT FOR UPDATE NOWAIT and PostgreSQL 8.0

pgsql-patches by date

Next:From: Tom LaneDate: 2004-09-14 03:21:59
Subject: Re: pltcl on win32
Previous:From: Peter EisentrautDate: 2004-09-13 20:53:20
Subject: Re: po update for zh_CN

pgsql-hackers-win32 by date

Next:From: Tom LaneDate: 2004-09-14 03:40:48
Subject: Re: [PATCHES] Contrib modules on Win32
Previous:From: Dave PageDate: 2004-09-13 08:58:34
Subject: Re: VC++ psql build broken

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group