Hmm, how does 'it stop working'?
Depending entirely on how the log rotation occurs, after the rotation you could be looking at the original file, it just has a .1 extension now.
RedHat's logrotate, for example and depending on the options supplied, may move/create. That is, it will move the existing file to a new location (and name) and create a new file of the original name. Now, your running script (which I've called logr.pl for ease of reference) doesn't refer to the log file by name but by inode. A good way to test this (under Linux) is to start your script:
logr.pl -f messages
and get the process ID of logr.pl. 'ls -l /proc/<PID>/fd' and look at the file handles that are in use by your process. Now manually rotate the file and repeat the 'ls' above. In my tests, the logr.pl still had the original file open.
Under other Unixes, 'lsof' or 'fuser' may provide similar info.
As to a fix, you could include signal handling in logr.pl to re-read the file (or simply restart) on receipt of SIGHUP, for example.

I hope that answers the question (correctly)


In reply to Re: Tailing rolling logs by coec
in thread Tailing rolling logs by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.