Greetings dear monks,

I am using POE::Wheel::FollowTail to parse a number of log files written to one central logging server. Unfortunately these files include the epoch time in the file name and a rolled over at midnight. The name of the new file should be predictable, it is a base name plus the epoch seconds at midnight.

I plan to act on the ResetEvent that should be generated when the file is removed. Then I want to change FollowTails' internal file name with something like ...

sub reset_handler { my ($heap, $wheel_id) = @_[HEAP, ARG0 ]; # I kept a ref to wheel under its ID in the heap my $wheel = $heap->{wheel}->{"wheel_$id"}; my $SELF_FILENAME = $POE::Wheel::FollowTail::SELF_FILENAME(); my $new_file = derive_new_name(); $wheel->[$SELF_FILENAME] = $new_file; return; }
when FollowTail tries to re-open the file it should pick up the new one. I think it should work with perhaps a little minor tweaking but is it sane to hook into internal details of FollowTail like this or is there a more sensible way to do this ?

Thanks for taking the time,
R.

Pereant, qui ante nos nostra dixerunt!

In reply to POE::Wheel::FollowTail with a changing filename to tail by Random_Walk

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.