| Sven Willenberger 2005-08-15, 11:24 am |
| On Sat, 2005-08-13 at 11:08 -0700, Mischa Sandberg wrote:
> Message-ID: <1123877471.5149.35.camel- cqFLHhBanuCnJLXTTsSY
+Q@public.gmane.org>
> logs to slony.out.0 -- i.e. it appears to latch onto the inode number of
> the logfile and will not renew it during a sighup.
>
> This is true: if you redirect output, the SHELL opens your .out file,
> once, and slon doesn't even know the name of that file.
>
Hadn't thought about that fact ... that would explain the -HUP situation
perfectly then.
> ...
> Now that looks like a real bug.
Should I report it as such? If not, any ideas on helping the devs with
more/better datapoints or debugging ideas?
>
> Since you're happy with logging by redirecting output to a file, I'll
> assume the following is acceptable ...
>
Actually I would much prefer to use the syslog system as I am not a huge
fan of redirecting stdout to logfiles.
> If you want, you can implement log rotation with a one-line shell
> script. Something like this (I have no Unix box at the moment to test
> this first, so bear with me on typos):
>
> $ (slon ... | while read; do echo $REPLY >mylog.$(date +%W); done) &
>
> (If I recall correctly, "date +%W" returns the day-of-the-week. Choose
> your granularity and cycle as you will; a new log every hour, for the
> last 30 days.
`date +%A` for day of week :-)
> slon doesn't log so much stuff (at -d0) that opening a file per line is
> a real kill. If you feel that's a concern, post again, and I'll post a
> small "C" program that does the rotation.
>
The shell command you posted above does work fine. I will try this and
compare to using apache's rotatelogs utility as suggested in another
reply in this thread.
Thanks again,
Sven
|