Thread: RE: [GENERAL] How to get timestamped pgsql logging?

RE: [GENERAL] How to get timestamped pgsql logging?

From
"Culberson, Philip"
Date:
Ed,

My own notes on how to get timestamped error logs refer to the file
"...src/include/utils/elog.h".  There is a commented out "#define
ELOG_TIMESTAMPS" line in that header as well. Since version 6.4, I have
always uncommented THAT line and I get timestamps in my error logs... can't
tell you why it doesn't work by doing it in the config.h file...

(I am currently using version 6.5.2, so it may have changed in the most
recent version.)

Hope this helps!

Phil Culberson

-----Original Message-----
From: Ed Loehr [mailto:ELOEHR@austin.rr.com]
Sent: Thursday, December 16, 1999 11:59 PM
To: pgsql-general@postgreSQL.org
Subject: [GENERAL] How to get timestamped pgsql logging?


After following some hints from Bruce Momjian and the pgsql documentation,
I'm still missing something on how to get timestamped backend logging from
pgsql...any help is appreciated...

After running ./configure, I modifed  ...src/include/config.h to uncomment
the two lines...

#define ELOG_TIMESTAMPS
#define USE_SYSLOG

Then I ran make, etc, created the file $PGDATA/pg_options...

% cat $PGDATA/pg_options
verbose=2
query
syslog=2

And restarted the server...and still no timestamps.

I verified most everything syslog-wise (configured in /etc/syslog.conf) is
being sent to /var/log/messages...

Anyone notice what am I missing?

Cheers,
Ed Loehr


************

************


RE: [GENERAL] How to get timestamped pgsql logging?

From
"Culberson, Philip"
Date:
Oh, one more thing.  I've always made the edit BEFORE running ./configure.

Phil Culberson

-----Original Message-----
From: Culberson, Philip
Sent: Friday, December 17, 1999 11:42 AM
To: 'Ed Loehr'; pgsql-general@postgreSQL.org
Subject: RE: [GENERAL] How to get timestamped pgsql logging?


Ed,

My own notes on how to get timestamped error logs refer to the file
"...src/include/utils/elog.h".  There is a commented out "#define
ELOG_TIMESTAMPS" line in that header as well. Since version 6.4, I have
always uncommented THAT line and I get timestamps in my error logs... can't
tell you why it doesn't work by doing it in the config.h file...

(I am currently using version 6.5.2, so it may have changed in the most
recent version.)

Hope this helps!

Phil Culberson

-----Original Message-----
From: Ed Loehr [mailto:ELOEHR@austin.rr.com]
Sent: Thursday, December 16, 1999 11:59 PM
To: pgsql-general@postgreSQL.org
Subject: [GENERAL] How to get timestamped pgsql logging?


After following some hints from Bruce Momjian and the pgsql documentation,
I'm still missing something on how to get timestamped backend logging from
pgsql...any help is appreciated...

After running ./configure, I modifed  ...src/include/config.h to uncomment
the two lines...

#define ELOG_TIMESTAMPS
#define USE_SYSLOG

Then I ran make, etc, created the file $PGDATA/pg_options...

% cat $PGDATA/pg_options
verbose=2
query
syslog=2

And restarted the server...and still no timestamps.

I verified most everything syslog-wise (configured in /etc/syslog.conf) is
being sent to /var/log/messages...

Anyone notice what am I missing?

Cheers,
Ed Loehr


************

Re: [GENERAL] How to get timestamped pgsql logging?

From
Ed Loehr
Date:
Thanks, Phil.  Still, the good mojo escapes me.  Time to cut my losses.

I commented USE_SYSLOG back out, then twiddled elog.h, twiddled config.h after
./configure (configure builds a new config.h), tried a few variation on
pg_options, all while bringing down postmaster, running 'make clean', 'make',
'make install', and restarting on each try.  I rebuilt with printf's in the
trace.c functions near the code segments using ELOG_TIMESTAMPS, but am not
even seeing that output...I can see the new libpq.so...*that* concerns me.
LD_LIBRARY_PATH is set correctly.

Latest incantation of pg_options is:

    verbose=2
    query

Also tried...

    all
    verbose=2
    query


Cheers,
Ed Loehr

"Culberson, Philip" wrote:

> Oh, one more thing.  I've always made the edit BEFORE running ./configure.
>
> Phil Culberson
>
> -----Original Message-----
> From: Culberson, Philip
> Sent: Friday, December 17, 1999 11:42 AM
> To: 'Ed Loehr'; pgsql-general@postgreSQL.org
> Subject: RE: [GENERAL] How to get timestamped pgsql logging?
>
> Ed,
>
> My own notes on how to get timestamped error logs refer to the file
> "...src/include/utils/elog.h".  There is a commented out "#define
> ELOG_TIMESTAMPS" line in that header as well. Since version 6.4, I have
> always uncommented THAT line and I get timestamps in my error logs... can't
> tell you why it doesn't work by doing it in the config.h file...
>
> (I am currently using version 6.5.2, so it may have changed in the most
> recent version.)
>
> Hope this helps!
>
> Phil Culberson
>
> -----Original Message-----
> From: Ed Loehr [mailto:ELOEHR@austin.rr.com]
> Sent: Thursday, December 16, 1999 11:59 PM
> To: pgsql-general@postgreSQL.org
> Subject: [GENERAL] How to get timestamped pgsql logging?
>
> After following some hints from Bruce Momjian and the pgsql documentation,
> I'm still missing something on how to get timestamped backend logging from
> pgsql...any help is appreciated...
>
> After running ./configure, I modifed  ...src/include/config.h to uncomment
> the two lines...
>
> #define ELOG_TIMESTAMPS
> #define USE_SYSLOG
>
> Then I ran make, etc, created the file $PGDATA/pg_options...
>
> % cat $PGDATA/pg_options
> verbose=2
> query
> syslog=2
>
> And restarted the server...and still no timestamps.
>
> I verified most everything syslog-wise (configured in /etc/syslog.conf) is
> being sent to /var/log/messages...
>
> Anyone notice what am I missing?
>
> Cheers,
> Ed Loehr
>
> ************


RE: [GENERAL] How to get timestamped pgsql logging?

From
"Culberson, Philip"
Date:
Ed,

Configure will used cached values if config.cache is available so you may
consider first doing a "make distclean", which is the mother of all
cleanouts.  Then do the ./configure, 'make', and 'make install'.

I have not yet configure SYSLOG for use, so I redirect all output from the
postmaster into a file with the following command:

exec postmaster -i -B 12000 -d 2 -o "-F -S 4096 -s" >&! server.log &

Phil Culberson

-----Original Message-----
From: Ed Loehr [mailto:ELOEHR@austin.rr.com]
Sent: Friday, December 17, 1999 2:21 PM
To: Culberson, Philip
Cc: 'pgsql-general@postgreSQL.org'
Subject: Re: [GENERAL] How to get timestamped pgsql logging?


Thanks, Phil.  Still, the good mojo escapes me.  Time to cut my losses.

I commented USE_SYSLOG back out, then twiddled elog.h, twiddled config.h
after
./configure (configure builds a new config.h), tried a few variation on
pg_options, all while bringing down postmaster, running 'make clean',
'make',
'make install', and restarting on each try.  I rebuilt with printf's in the
trace.c functions near the code segments using ELOG_TIMESTAMPS, but am not
even seeing that output...I can see the new libpq.so...*that* concerns me.
LD_LIBRARY_PATH is set correctly.

Latest incantation of pg_options is:

    verbose=2
    query

Also tried...

    all
    verbose=2
    query


Cheers,
Ed Loehr

"Culberson, Philip" wrote:

> Oh, one more thing.  I've always made the edit BEFORE running ./configure.
>
> Phil Culberson
>
> -----Original Message-----
> From: Culberson, Philip
> Sent: Friday, December 17, 1999 11:42 AM
> To: 'Ed Loehr'; pgsql-general@postgreSQL.org
> Subject: RE: [GENERAL] How to get timestamped pgsql logging?
>
> Ed,
>
> My own notes on how to get timestamped error logs refer to the file
> "...src/include/utils/elog.h".  There is a commented out "#define
> ELOG_TIMESTAMPS" line in that header as well. Since version 6.4, I have
> always uncommented THAT line and I get timestamps in my error logs...
can't
> tell you why it doesn't work by doing it in the config.h file...
>
> (I am currently using version 6.5.2, so it may have changed in the most
> recent version.)
>
> Hope this helps!
>
> Phil Culberson
>
> -----Original Message-----
> From: Ed Loehr [mailto:ELOEHR@austin.rr.com]
> Sent: Thursday, December 16, 1999 11:59 PM
> To: pgsql-general@postgreSQL.org
> Subject: [GENERAL] How to get timestamped pgsql logging?
>
> After following some hints from Bruce Momjian and the pgsql documentation,
> I'm still missing something on how to get timestamped backend logging from
> pgsql...any help is appreciated...
>
> After running ./configure, I modifed  ...src/include/config.h to uncomment
> the two lines...
>
> #define ELOG_TIMESTAMPS
> #define USE_SYSLOG
>
> Then I ran make, etc, created the file $PGDATA/pg_options...
>
> % cat $PGDATA/pg_options
> verbose=2
> query
> syslog=2
>
> And restarted the server...and still no timestamps.
>
> I verified most everything syslog-wise (configured in /etc/syslog.conf) is
> being sent to /var/log/messages...
>
> Anyone notice what am I missing?
>
> Cheers,
> Ed Loehr
>
> ************


************

Re: [GENERAL] How to get timestamped pgsql logging?

From
Ed Loehr
Date:
When I couldn't even get my own newly added printfs to show up, that was the
tipoff.  Redhat 6.1 installs postmaster in /bin.  I didn't know it, and have
been building/installing elsewhere.  /bin, of course, is first in my PATH,
before *my* pgsql install bin.  Ouch.  Timestamping is now working.  Thanks
much for your efforts.

Cheers,
Ed Loehr

"Culberson, Philip" wrote:

> Ed,
>
> Configure will used cached values if config.cache is available so you may
> consider first doing a "make distclean", which is the mother of all
> cleanouts.  Then do the ./configure, 'make', and 'make install'.
>
> I have not yet configure SYSLOG for use, so I redirect all output from the
> postmaster into a file with the following command:
>
> exec postmaster -i -B 12000 -d 2 -o "-F -S 4096 -s" >&! server.log &
>
> Phil Culberson
>
> -----Original Message-----
> From: Ed Loehr [mailto:ELOEHR@austin.rr.com]
> Sent: Friday, December 17, 1999 2:21 PM
> To: Culberson, Philip
> Cc: 'pgsql-general@postgreSQL.org'
> Subject: Re: [GENERAL] How to get timestamped pgsql logging?
>
> Thanks, Phil.  Still, the good mojo escapes me.  Time to cut my losses.
>
> I commented USE_SYSLOG back out, then twiddled elog.h, twiddled config.h
> after
> ./configure (configure builds a new config.h), tried a few variation on
> pg_options, all while bringing down postmaster, running 'make clean',
> 'make',
> 'make install', and restarting on each try.  I rebuilt with printf's in the
> trace.c functions near the code segments using ELOG_TIMESTAMPS, but am not
> even seeing that output...I can see the new libpq.so...*that* concerns me.
> LD_LIBRARY_PATH is set correctly.
>
> Latest incantation of pg_options is:
>
>     verbose=2
>     query
>
> Also tried...
>
>     all
>     verbose=2
>     query
>
> Cheers,
> Ed Loehr
>
> "Culberson, Philip" wrote:
>
> > Oh, one more thing.  I've always made the edit BEFORE running ./configure.
> >
> > Phil Culberson
> >
> > -----Original Message-----
> > From: Culberson, Philip
> > Sent: Friday, December 17, 1999 11:42 AM
> > To: 'Ed Loehr'; pgsql-general@postgreSQL.org
> > Subject: RE: [GENERAL] How to get timestamped pgsql logging?
> >
> > Ed,
> >
> > My own notes on how to get timestamped error logs refer to the file
> > "...src/include/utils/elog.h".  There is a commented out "#define
> > ELOG_TIMESTAMPS" line in that header as well. Since version 6.4, I have
> > always uncommented THAT line and I get timestamps in my error logs...
> can't
> > tell you why it doesn't work by doing it in the config.h file...
> >
> > (I am currently using version 6.5.2, so it may have changed in the most
> > recent version.)
> >
> > Hope this helps!
> >
> > Phil Culberson
> >
> > -----Original Message-----
> > From: Ed Loehr [mailto:ELOEHR@austin.rr.com]
> > Sent: Thursday, December 16, 1999 11:59 PM
> > To: pgsql-general@postgreSQL.org
> > Subject: [GENERAL] How to get timestamped pgsql logging?
> >
> > After following some hints from Bruce Momjian and the pgsql documentation,
> > I'm still missing something on how to get timestamped backend logging from
> > pgsql...any help is appreciated...
> >
> > After running ./configure, I modifed  ...src/include/config.h to uncomment
> > the two lines...
> >
> > #define ELOG_TIMESTAMPS
> > #define USE_SYSLOG
> >
> > Then I ran make, etc, created the file $PGDATA/pg_options...
> >
> > % cat $PGDATA/pg_options
> > verbose=2
> > query
> > syslog=2
> >
> > And restarted the server...and still no timestamps.
> >
> > I verified most everything syslog-wise (configured in /etc/syslog.conf) is
> > being sent to /var/log/messages...
> >
> > Anyone notice what am I missing?
> >
> > Cheers,
> > Ed Loehr
> >
> > ************
>
> ************
>
> ************


RE: [GENERAL] How to get timestamped pgsql logging?

From
"Culberson, Philip"
Date:
Ed,

My own notes on how to get timestamped error logs refer to the file
"...src/include/utils/elog.h".  There is a commented out "#define
ELOG_TIMESTAMPS" line in that header as well. Since version 6.4, I have
always uncommented THAT line and I get timestamps in my error logs... can't
tell you why it doesn't work by doing it in the config.h file...

(I am currently using version 6.5.2, so it may have changed in the most
recent version.)

Hope this helps!

Phil Culberson

-----Original Message-----
From: Ed Loehr [mailto:ELOEHR@austin.rr.com]
Sent: Thursday, December 16, 1999 11:59 PM
To: pgsql-general@postgreSQL.org
Subject: [GENERAL] How to get timestamped pgsql logging?


After following some hints from Bruce Momjian and the pgsql documentation,
I'm still missing something on how to get timestamped backend logging from
pgsql...any help is appreciated...

After running ./configure, I modifed  ...src/include/config.h to uncomment
the two lines...

#define ELOG_TIMESTAMPS
#define USE_SYSLOG

Then I ran make, etc, created the file $PGDATA/pg_options...

% cat $PGDATA/pg_options
verbose=2
query
syslog=2

And restarted the server...and still no timestamps.

I verified most everything syslog-wise (configured in /etc/syslog.conf) is
being sent to /var/log/messages...

Anyone notice what am I missing?

Cheers,
Ed Loehr


************

************