On Thu, 2007-02-08 at 12:08 -0500, Mark Stosberg wrote:
> Dan Falconer wrote:
> > On Wednesday 07 February 2007 2:23 pm, Mark Stosberg wrote:
> >> Dan Falconer wrote:
> >>> On Wednesday 07 February 2007 1:00 pm, Mark Stosberg wrote:
> >>>> Here's a report and a question on log rotation using the altperl tools,
> >>>> on FreeBSD.
> >>> [ --xxxx-- snip --xxxx--]
> >>>
> >>>> So I tried the "APACHE_ROTATOR" method, which the altperl tools have
> >>>> built-in support for.
> >>>>
> >>>> That started creating new log files every 10 seconds, which also seemed
> >>>> like a bad idea! I created this patch to slon-tools.pm to only create
> >>>> one log file per day:
> >>> [ --xxxx-- snip --xxxx--]
> >>>
> >>>> Even then, doesn't that leave me with a pruning job to do? I don't see
> >>>> the value of including the time stamp in the log file name. That just
> >>>> seems to complicate log file rotation and pruning, and is non-standard
> >>>> from what I've seen.
> >>>   I encountered this in Slony 1.2.6 as well: in 1.1.0, there was a
> >>> configuration parameter, "$ROTATE_TIME", which was fed to the apache
> >>> rotator instead of the arbitrary "10M".  Ours was set to 86400 (every 24
> >>> hours).  I was assuming it was an oops, but I removed the APACHE_ROTATOR
> >>> variable out of my configuration files so it wouldn't even try to rotate
> >>> them... which of course means I have to manually restart slony every once
> >>> in a while to avoid running out of space.
> >> Does it make more sense then to prune out the timestamp stuff out of the
> >> APACHE_ROTATOR line, and add the "86400" value back in?
> >> Then, would it still be necessary to purge logs every so often?
> >>
> >>   Mark
> > 
> >     The timestamp thing *REALLY* pisses me off.  I would at worst having a 
> > logname like "$dbname-$dateItStarted.log", at best having "$dbname.log" 
> > which 
> > is rotated using the standard "$dbname.log.1", "$dbname.log.2", etc... 
> > considering the size of the logs on my system (350 megs after a few days), 
> > I 
> > would prefer them getting zipped, too... but I can do that myself if it 
> > can't 
> > be worked in.
> 
> Could Slony be modified to "let go" of the existing  log file handle
> when an HUP is received, like Apache does?  That would allow the
> standard features of newsyslog to be used, and would be a lot easier to
> manage.
> 
> (For example, I don't have Apache on my database services, so I had to
> copy 'rotatelogs' from another machine... )
> 
> Now I'm using rotatelogs, plus newsyslog for compression, and I've got:
> 
> db_2007-02-07.log
> db_2007-02-07.log.0.bz2
> db_2007-02-08.log
> db_2007-02-08.log.0.bz2
> 
> Including even just the date in the name still messes up standard log
> rotation practices.
> 
>    Mark
> 
As of this release (1.2.6) I am finally able to use syslog for logging
purposes which makes rotation a snap. The relevant files and lines:

***from slon.conf:
syslog 2
syslog_facility 'LOCAL1'
log_level 1
log_timestamp 0
log_pid 1

***from syslog.conf
*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err;LOCAL1.none   
/var/log/messages
LOCAL1.*                                        /var/log/slony.log

***from newsyslog.conf
/var/log/slony.log                      640  7     *    @T00  JC

This on a FreeBSD box. I say "finally" because prior to this release I
had issues with worker threads not being found and an ever-increasing
number of cleanup events per time period. (see my posts from Nov 30 2005
entitled: "[Slony1-general] Worker threads not seen by slon process"

Sven

_______________________________________________
Slony1-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/slony1-general

Reply via email to