Thread: logging problem ... ?

logging problem ... ?

From
The Hermit Hacker
Date:
Okay, I'm at a loss here ... I'm trying to futz with pg_options, based on
the docs in users-lounge/7.0/docs, and with:

pgsql% cat data/pg_options
verbose=2
query
hostlookup
showportnumber

All I'm getting in my log file is this continuously scrolling:

FindExec: found "/pgsql/bin/postgres" using argv[0]
FindExec: found "/pgsql/bin/postgres" using argv[0]
FindExec: found "/pgsql/bin/postgres" using argv[0]
FindExec: found "/pgsql/bin/postgres" using argv[0]
FindExec: found "/pgsql/bin/postgres" using argv[0]

even if I issue a query through psql, that is all I see ...

Is this broken? *raised eyebrow*

Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 



Re: logging problem ... ?

From
Tom Lane
Date:
The Hermit Hacker <scrappy@hub.org> writes:
> All I'm getting in my log file is this continuously scrolling:

> FindExec: found "/pgsql/bin/postgres" using argv[0]
> FindExec: found "/pgsql/bin/postgres" using argv[0]

Well, that shows you're launching backends anyway ;-)

It looks like the backends are receiving -d 1 from the postmaster,
but where is the postmaster's own debug output?  Weird.  How exactly
are you starting the postmaster, again?
        regards, tom lane


Re: logging problem ... ?

From
The Hermit Hacker
Date:
On Mon, 8 May 2000, Tom Lane wrote:

> The Hermit Hacker <scrappy@hub.org> writes:
> > All I'm getting in my log file is this continuously scrolling:
> 
> > FindExec: found "/pgsql/bin/postgres" using argv[0]
> > FindExec: found "/pgsql/bin/postgres" using argv[0]
> 
> Well, that shows you're launching backends anyway ;-)

Ya, but, from what i can tell, there are not as many backends being
started as that scrolling list of 'FindExec's appear to be indicating
... the server isn't *that* busy ...

> It looks like the backends are receiving -d 1 from the postmaster,
> but where is the postmaster's own debug output?  Weird.  How exactly
> are you starting the postmaster, again?

cat ~pgsql/pgstart ... postmaster's own debug output?  ya know, for some
stupid reason, the only thing i'm capturing is postgres's output :(  I
just modified the pgstart script and restarted the server, so postmaster's
output is to logs/postmaster.5432 ...



Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 



Re: logging problem ... ?

From
Tom Lane
Date:
The Hermit Hacker <scrappy@hub.org> writes:
> cat ~pgsql/pgstart ... postmaster's own debug output?  ya know, for some
> stupid reason, the only thing i'm capturing is postgres's output :(  I
> just modified the pgstart script and restarted the server, so postmaster's
> output is to logs/postmaster.5432 ...

Oh, I see the problem!  It's the -S in the postmaster switches:

${POSTMASTER} -d 1 -B 4096 -N 128 -S \                                 ^^

That redirects postmaster's stdout/stderr to /dev/null, so you never
see anything in its log except for a message or two that comes out
before -S is processed.  Instead of -S you should be using

nohup ${POSTMASTER} same-switches-except-S \</dev/null  >& logs/postmaster.${PORT}  &

(I'm not sure if redirecting stdin to /dev/null is really necessary on
your OS, but it is on mine.)
        regards, tom lane


Re: logging problem ... ?

From
The Hermit Hacker
Date:
D'oh ... there ya go, lotsa days flying through now ... 

On Mon, 8 May 2000, Tom Lane wrote:

> The Hermit Hacker <scrappy@hub.org> writes:
> > cat ~pgsql/pgstart ... postmaster's own debug output?  ya know, for some
> > stupid reason, the only thing i'm capturing is postgres's output :(  I
> > just modified the pgstart script and restarted the server, so postmaster's
> > output is to logs/postmaster.5432 ...
> 
> Oh, I see the problem!  It's the -S in the postmaster switches:
> 
> ${POSTMASTER} -d 1 -B 4096 -N 128 -S \
>                                   ^^
> 
> That redirects postmaster's stdout/stderr to /dev/null, so you never
> see anything in its log except for a message or two that comes out
> before -S is processed.  Instead of -S you should be using
> 
> nohup ${POSTMASTER} same-switches-except-S \
>     </dev/null  >& logs/postmaster.${PORT}  &
> 
> (I'm not sure if redirecting stdin to /dev/null is really necessary on
> your OS, but it is on mine.)
> 
>             regards, tom lane
> 

Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 



Re: logging problem ... ?

From
Tom Lane
Date:
The Hermit Hacker <scrappy@hub.org> writes:
> D'oh ... there ya go, lotsa days flying through now ... 

Ah, much better.  You just *thought* you weren't launching a backend
every second or so :-)

Kinda looks like the backend -o switch doesn't redirect as much as
I would've thought --- most of the backend's debug output is coming
out in the postmaster log not the other file.  Something to look at
later.
        regards, tom lane


Re: logging problem ... ?

From
The Hermit Hacker
Date:
On Mon, 8 May 2000, Tom Lane wrote:

> The Hermit Hacker <scrappy@hub.org> writes:
> > D'oh ... there ya go, lotsa days flying through now ... 
> 
> Ah, much better.  You just *thought* you weren't launching a backend
> every second or so :-)

tell me about it ... now, if it were possible to redirect each backend to
a seperate file, so that I had X files pertaining to what happened through
that backend, that would be cool ... maybe play with v7.1 on this one :)

> Kinda looks like the backend -o switch doesn't redirect as much as
> I would've thought --- most of the backend's debug output is coming
> out in the postmaster log not the other file.  Something to look at
> later.

*nod*

Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 



Re: logging problem ... ?

From
Peter Eisentraut
Date:
The Hermit Hacker writes:

> tell me about it ... now, if it were possible to redirect each backend to
> a seperate file, so that I had X files pertaining to what happened through
> that backend, that would be cool ... maybe play with v7.1 on this one :)

You can compile with ELOG_TIMESTAMPS to tag each log message with a pid
(besides the timestamp).

> > Kinda looks like the backend -o switch doesn't redirect as much as
> > I would've thought --- most of the backend's debug output is coming
> > out in the postmaster log not the other file.  Something to look at
> > later.

This might explain it:

peter ~/pgsql/src/backend$ find -name '*.c' | \                          xargs egrep 'fprintf *\(stderr' | wc -l   232


-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden