RE: [squid-users] Rotating Logs

From: Henrik Nordstrom <henrik@dont-contact.us>
Date: Thu, 06 Apr 2006 00:21:01 +0200

ons 2006-04-05 klockan 16:07 -0400 skrev Nick Duda:
> I thought it can cause problems manipulating (moving, renaming,
> editing...etc) the log file while the squid process has it open.
> That's what -k rotate is for, am I wrong?

There is no problem rotating log files while Squid is running, but you
need to run "squid -k rotate" after rotating the logs to tell Squid to
reopen new log files, and make sure Squid has actually done this before
you do anything with the rotated log files..

This is exactly the situation "logfile_rotate 0" is designed for. With
this configuration "squid -k rotate" only reopens the log files, and
relies on you renaming old the files first.. same as UNIX syslog and
many other daemons with log files btw.

> Your moving the file before rotating, wouldn't that cause an issue?

Not on UNIX as UNIX keeps filenames separate from files.. a UNIX file
can have as many names you like, from 0 to infinity, and this can be
changed as you like while the file is still open.

But it may get a little confusing if you forget to run "squid -k rotate"
after renaming the files as Squid will then continue writing to the
"old" files.

Regards
Henrik

Received on Wed Apr 05 2006 - 16:21:09 MDT

This archive was generated by hypermail pre-2.1.9 : Mon May 01 2006 - 12:00:02 MDT