pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Postgres/Postmaster logging and log rotation
5+ messages / 5 participants
[nested] [flat]

* Postgres/Postmaster logging and log rotation
@ 2001-03-07 15:11 William L James <BJames@inetmi.com>
  2001-03-07 15:37 ` Re: Postgres/Postmaster logging and log rotation root <root@dennis.veritime.com>
  2001-03-07 16:44 ` Re: Postgres/Postmaster logging and log rotation Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 2 replies; 5+ messages in thread

From: William L James @ 2001-03-07 15:11 UTC (permalink / raw)
  To: pgsql-admin

Hi there:

We are running PostgreSQL 7.0.2 on RedHat Linux 6.2 and
have encountered a few strange problems that continue to
elude us - namely INSERT and DELETE functions that end
abnormally, but do not include any information as to why (the
JDBC connection just seems to have gone away).  Trying to
further diagnose the situation, I have been successful in starting
the Postgres logging (by including the following in the postgresql
script - su -l postgresql -c "/usr/bin/pg_ctl -D $PGDATA -p
/usr/bin/postmaster start >>/var/log/postgresql 2>&1"), but
when the weekly logrotate.d function kicks in, Postgres logging
stops.  We also have trouble doing a simple restart - I wind up
having to do a stop and then a start minutes later.  Can anyone
explain how to get Postgres to log and to be able to rotate the
log periodically?  Any information would be appreciated.

Thanks,
Bill James
I/NET, Inc.
Email: mailto:bjames@inetmi.com
WWW: http://www.inetmi.com





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Postgres/Postmaster logging and log rotation
  2001-03-07 15:11 Postgres/Postmaster logging and log rotation William L James <BJames@inetmi.com>
@ 2001-03-07 15:37 ` root <root@dennis.veritime.com>
  2001-03-19 13:00   ` Re: Postgres/Postmaster logging and log rotation Robert Hentosh <hentosh@io.com>
  1 sibling, 1 reply; 5+ messages in thread

From: root @ 2001-03-07 15:37 UTC (permalink / raw)
  To: William L James <BJames@inetmi.com>; pgsql-admin

Be sure to stop postgres, rotate your log (or move it out of the /var/log
directory and then rotate it), and restart postgresql.  That will solve your
problem.  Hopefully you don't need a 24x7 available database as this might take
a few seconds for your server to complete.

On Wed, 07 Mar 2001, William L James wrote:
> Hi there:
> 
> We are running PostgreSQL 7.0.2 on RedHat Linux 6.2 and
> have encountered a few strange problems that continue to
> elude us - namely INSERT and DELETE functions that end
> abnormally, but do not include any information as to why (the
> JDBC connection just seems to have gone away).  Trying to
> further diagnose the situation, I have been successful in starting
> the Postgres logging (by including the following in the postgresql
> script - su -l postgresql -c "/usr/bin/pg_ctl -D $PGDATA -p
> /usr/bin/postmaster start >>/var/log/postgresql 2>&1"), but
> when the weekly logrotate.d function kicks in, Postgres logging
> stops.  We also have trouble doing a simple restart - I wind up
> having to do a stop and then a start minutes later.  Can anyone
> explain how to get Postgres to log and to be able to rotate the
> log periodically?  Any information would be appreciated.
> 
> Thanks,
> Bill James
> I/NET, Inc.
> Email: mailto:bjames@inetmi.com
> WWW: http://www.inetmi.com
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://www.postgresql.org/search.mpl
-- 
Thanks, 


Rodney Hampton
veritime.com
248-528-9766



----Your analogies DO NOT need to work as long as your code DOES.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Postgres/Postmaster logging and log rotation
  2001-03-07 15:11 Postgres/Postmaster logging and log rotation William L James <BJames@inetmi.com>
  2001-03-07 15:37 ` Re: Postgres/Postmaster logging and log rotation root <root@dennis.veritime.com>
@ 2001-03-19 13:00   ` Robert Hentosh <hentosh@io.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Robert Hentosh @ 2001-03-19 13:00 UTC (permalink / raw)
  To: pgsql-admin


Try the copytruncate directive in the logrotate configuration file. (See 'man logrotate').  This should allow it to work without restarting postgresql. But as the man file says, there is a small chance of losing some log entries.

On Wed, Mar 07, 2001 at 10:37:30AM -0500, root wrote:
> Be sure to stop postgres, rotate your log (or move it out of the /var/log
> directory and then rotate it), and restart postgresql.  That will solve your
> problem.  Hopefully you don't need a 24x7 available database as this might take
> a few seconds for your server to complete.
> 
> On Wed, 07 Mar 2001, William L James wrote:
> > Hi there:
> > 
> > We are running PostgreSQL 7.0.2 on RedHat Linux 6.2 and
> > have encountered a few strange problems that continue to
> > elude us - namely INSERT and DELETE functions that end
> > abnormally, but do not include any information as to why (the
> > JDBC connection just seems to have gone away).  Trying to
> > further diagnose the situation, I have been successful in starting
> > the Postgres logging (by including the following in the postgresql
> > script - su -l postgresql -c "/usr/bin/pg_ctl -D $PGDATA -p
> > /usr/bin/postmaster start >>/var/log/postgresql 2>&1"), but
> > when the weekly logrotate.d function kicks in, Postgres logging
> > stops.  We also have trouble doing a simple restart - I wind up
> > having to do a stop and then a start minutes later.  Can anyone
> > explain how to get Postgres to log and to be able to rotate the
> > log periodically?  Any information would be appreciated.
> > 
> > Thanks,
> > Bill James

> -- 
> Thanks, 
> 
> 
> Rodney Hampton



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Postgres/Postmaster logging and log rotation
  2001-03-07 15:11 Postgres/Postmaster logging and log rotation William L James <BJames@inetmi.com>
@ 2001-03-07 16:44 ` Peter Eisentraut <peter_e@gmx.net>
  2001-03-07 17:13   ` Re: Postgres/Postmaster logging and log rotation Lamar Owen <lamar.owen@wgcr.org>
  1 sibling, 1 reply; 5+ messages in thread

From: Peter Eisentraut @ 2001-03-07 16:44 UTC (permalink / raw)
  To: William L James <BJames@inetmi.com>; +Cc: pgsql-admin

William L James writes:

> script - su -l postgresql -c "/usr/bin/pg_ctl -D $PGDATA -p
> /usr/bin/postmaster start >>/var/log/postgresql 2>&1"), but
> when the weekly logrotate.d function kicks in, Postgres logging
> stops.

The logging probably continues to go to the rotated-away file.  The
typical log rotation cron job presumes that the daemons close the log
files periodically.  This is not the case with PostgreSQL.  A good
solution is to pipe your log output to a small program that does the log
rotating (or simply closes the log file once in a while), like rotatelogs
from Apache.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Postgres/Postmaster logging and log rotation
  2001-03-07 15:11 Postgres/Postmaster logging and log rotation William L James <BJames@inetmi.com>
  2001-03-07 16:44 ` Re: Postgres/Postmaster logging and log rotation Peter Eisentraut <peter_e@gmx.net>
@ 2001-03-07 17:13   ` Lamar Owen <lamar.owen@wgcr.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Lamar Owen @ 2001-03-07 17:13 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: William L James <BJames@inetmi.com>; pgsql-admin

Peter Eisentraut wrote:
> William L James writes:
> > script - su -l postgresql -c "/usr/bin/pg_ctl -D $PGDATA -p
> > /usr/bin/postmaster start >>/var/log/postgresql 2>&1"), but
> > when the weekly logrotate.d function kicks in, Postgres logging
> > stops.
 
> The logging probably continues to go to the rotated-away file.  The
> typical log rotation cron job presumes that the daemons close the log

The logrotate.d script included in the RPM is intended for a
syslog-generated logfile.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2001-03-19 13:00 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-03-07 15:11 Postgres/Postmaster logging and log rotation William L James <BJames@inetmi.com>
2001-03-07 15:37 ` root <root@dennis.veritime.com>
2001-03-19 13:00   ` Robert Hentosh <hentosh@io.com>
2001-03-07 16:44 ` Peter Eisentraut <peter_e@gmx.net>
2001-03-07 17:13   ` Lamar Owen <lamar.owen@wgcr.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox