RE: [squid-users] Rotation of Log Files

From: Henrik Nordstrom <hno@dont-contact.us>
Date: 24 Jan 2003 12:12:18 +0100

External log rotation:

You use another program for rotating the Squid log files by renaming and
then tells Squid that the files have been rotated.

Works in the same manner as done for most other daemons such as syslog,
Apache, etc.

If the files are then post-processed such as compression etc then it is
the responsibility of the external program to ensure it waits until the
daemon (Squid / Syslog/ Apache / whatever) have reopened the log files
(which also means it has closed the old log file).

Note: UNIX allows renaming of open files without disturbing the
application having the file open. Writes to the open file will still be
sent to the same file even if it has been renamed.

Regards
Henrik

fre 2003-01-24 klockan 09.04 skrev Reckhard, Tobias:
> Hi Henrik
>
> Replying to your message to Squid Users:
>
> > -----Original Message-----
> > From: Henrik Nordstrom [mailto:hno@squid-cache.org]
> > Sent: Thursday, January 09, 2003 7:22 PM
> > To: Technology Listserves
> > Cc: <
> > Subject: Re: [squid-users] Rotation of Log Files
>
> [snip]
>
> > If you want more flexible log rotation then use a external
> > log rotation
> > tools such as "logrotate" or similar, and set "logfile_rotate 0" in
> > squid.conf. (see squid.conf comments on meaning of 0)
>
> I'm planning to use that mechanism, but I haven't understood how it's
> supposed to work yet. Unfortunately, the information in the FAQ is too brief
> for me. Perhaps you could clear things up? I'd be very grateful.
>
> The FAQ says that Squid closes and reopens the file when "logfile_rotate 0"
> is set and you issue a "squid -k rotate". I believe the external program,
> such as logrotate, should either move the file or copy it and do "cp
> /dev/null <oldfile>" between the point when Squid has closed the file and
> the point when it is reopened (does Squid create a new log file if the old
> one has gone?). But how can I call a process inbetween those actions? It
> seems to me that from a shell script perspective, they are compounded into
> one atomic action..
>
> Do you understand what I mean? And do you have an explanation?
>
> Thanks for any insights,
> Tobias

-- 
Henrik Nordstrom <hno@squid-cache.org>
MARA Systems AB, Sweden
Received on Fri Jan 24 2003 - 04:12:47 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:12:49 MST