[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SAGE] SUMMARY: circular log trimming tool (long)



>>>>> dnb  writes:

 > Howdy-
 >   Sorry it has taken so long to write this up. I wanted to make sure
 >   to feed back a summary to the list of the information I
 >   collected. Many thanks to everyone who responded to my question. If
 >   I omit your name below, please accept my apology.

Thanks for the excellent summary.

 > ORIGINAL QUESTION:

 >   I was looking for a program that could take a single log file and
 >   keep it under a constant size by trimming older lines off the
 >   top. This request was different from the usual log wrangling
 >   programs that perform what John Sellens succinctly called "cascading
 >   rename of log files." Our goal was to keep only a single copy of
 >   each log file that was made to stay under a certain size.

I'm wandering slightly off the original topic -- but John Sellens
term "cascading rename of log files" reminded me of something.

I don't like "cascading rename of log files" and here is why:

 If you have an incident reported in a log file, and you
 reference that incident by filename then that reference
 will inevitably become stale after one cycle of log file
 renaming.

 ie: the file server melted down this morning, 
     the evidence is in /net/m5/etc/messages today.

     tomorrow it may be in messages.0
     next week in messages.1

Suppose that each logfile name is unique--by adding date information
in the filename:

     the file server melted down, etc
     the evidence is in /net/m5/etc/messages-m5-2003-ww12,
     also available as /net/m5/etc/messages (via symlink).

     with this technique the logfile name will never change
     until the file is deleted. 
     you can also copy the logfiles from several sources into
     the same directory without collision:

           messages-m5-2003-ww12
           messages-wopr-2003-ww12
           messages-deepthought-2003-ww12
           messages-escher-2003-ww12

Your log rotations has to be a little smarter, but this is 
really a SMOP.

-- 
Quentin Fennessy   		Quentin.Fennessy@amd.com
				Office: 512.602.3873
				Cell:   512.694.7489