I have written a long running perl application to help me with some trivial 
administrative functions.  Due to the
volume of logging generated by this application, I am managing its output with 
logrotate.  The problem I face is that
perl is "following" the log files that logrotate swaps out.  While this is probably 
intelligent on perl's part (to
follow the file descriptor rather than the file name), it is presenting a major 
problem for me.  When "logfile" becomes
"logfile.1" (etc), my application follows that move and "continues" logging to the new 
"logfile.1" instead of losing
that file handle -- a condition which I check for so that I can reopen the log file 
using the proper file name,
"logfile".
    Ultimately, perl will only lose the file handle when logrotate finally deletes the 
"last file" in the log rotation
scheme.  Unfortunately, I will have lost a week's worth of logs because all that data 
will have been in the single file.
Additionally, I'll have several empty log file copies named .1, .2, .3, etc.  How can 
I set perl to NOT follow the file
when it is renamed by logrotate, such that a condition will be created where I will be 
able to initialize the
replacement file?

Thanks!!

- William Kimball
  "Programming is an art-form that fights back!"



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to