Arusha log rotation
Will Partain <[email protected]>
| Newsgroups | gmane.comp.sysutils.ark.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, folks; I had a mini-Aha! over log-file rotation and thought I would note it... It shows how the Arusha Project is about looking at things a bit differently and how (at least) I'm still learning the implications of the Arusha Way... Rotating log files is something I haven't gotten right. "Right", for me, includes: (a) rotating *all* of the log files for *all* services (including weird-and-wonderful 3rd-party software) on *all* machines -- not missing *any*; (b) doing whatever ancillary gunk is required, e.g. HUPping syslog; (c) gathering up *all* the log files from all services on all hosts in one convenient place (if only to write them to tape for later-if-ever perusal). My first thought was conventional: "write a log-rotating program" (or hack on an existing one). But the Arusha Way is to define for *all* packages a <rotate-log> method (which defaults to doing nothing). Put your syslog-rotating code in your syslog-config package; put your Cadence-weirdness-rotating code in your cadence-weirdness package, etc. Then you just have your overnight per-host cron job do... ark package rotate-logs --hosts=. ALL--ALL As ever, when packages move in/out of the system, the log-rotation takes care of itself. Actual implementation left as an exercise for the reader :-) Will