Log Rotation

Lowell Gilbert freebsd-questions-local at be-well.ilk.org
Sun Dec 28 10:34:10 PST 2003


Scott W <wegster at mindcore.net> writes:

> Just a guess here, but what the problem likely is is that Postgres
> keeps a file descriptor open to it's logfile, which means that
> 'simple' log rotation, eg just moving the original logfile to a backup
> name or gzipped file will break the logging as pg won't have a valid
> file descriptor any more.  This one's bit a project I worked on
> forever ago (on a production system! :-( ) running Solaris and
> Sybase...
> 
> The easy solution is to see if any of the log rotation scripts have
> the 'right' behavior...if not, you can write your own script to do it,
> test it by rotating the logs and then intentionally doing something to
> produce log output (depending on your log level)...if you get the log
> output, everything's happy. 

Postgres knows how to use syslog(8) for its logging, which is another
option also quite simple...


More information about the freebsd-questions mailing list