pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Built-in log rotation
2+ messages / 2 participants
[nested] [flat]

* Built-in log rotation
@ 2007-02-19 15:34  Kris Kiger <kris@musicrebellion.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Kris Kiger @ 2007-02-19 15:34 UTC (permalink / raw)
  To: pgsql-admin

Greetings!  I've been doing some research into log rotation software and 
ran into this, while looking through the postgres site:

"There is a built-in log rotation program, which you can use by setting 
the configuration parameter redirect_stderr to true in postgresql.conf."
http://www.postgresql.org/docs/8.1/interactive/logfile-maintenance.html

My question is, how does it rotate logs?  Does it perform a 
copy/truncate of the logfile?  I know in older versions of postgres, if 
you tried to move the log file, and create one with the same name, the 
server wouldn't actually write to it without a restart...at least in 
linux it wouldn't.  Do many of you use this mechanism?  If not, what 
have you found to be a reliable solution?

Thanks in advance for the info!

- Kris



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

* Re: Built-in log rotation
@ 2007-02-19 15:53  Alvaro Herrera <alvherre@commandprompt.com>
  parent: Kris Kiger <kris@musicrebellion.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Alvaro Herrera @ 2007-02-19 15:53 UTC (permalink / raw)
  To: Kris Kiger <kris@musicrebellion.com>; +Cc: pgsql-admin

Kris Kiger wrote:
> Greetings!  I've been doing some research into log rotation software and 
> ran into this, while looking through the postgres site:
> 
> "There is a built-in log rotation program, which you can use by setting 
> the configuration parameter redirect_stderr to true in postgresql.conf."
> http://www.postgresql.org/docs/8.1/interactive/logfile-maintenance.html
> 
> My question is, how does it rotate logs?

It closes the old file and opens a new one -- new name, new file
descriptor, so the problem you mention below doesn't exist anymore.

> Does it perform a 
> copy/truncate of the logfile?  I know in older versions of postgres, if 
> you tried to move the log file, and create one with the same name, the 
> server wouldn't actually write to it without a restart...at least in 
> linux it wouldn't.

This code is "new" (only two years old).

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



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


end of thread, other threads:[~2007-02-19 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-02-19 15:34 Built-in log rotation Kris Kiger <kris@musicrebellion.com>
2007-02-19 15:53 ` Alvaro Herrera <alvherre@commandprompt.com>

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