Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Tail rotating logfiles with tie

by PotPieMan (Hermit)
on Sep 30, 2004 at 15:21 UTC ( [id://395375]=note: print w/replies, xml ) Need Help??


in reply to Tail rotating logfiles with tie

You might have found it in your research, but I've had luck with File::Tail. It lets you tie a filehandle to a rotating log file, automatically reopening the file if it detects that the file was truncated.

CPAN Testers says it fails on Windows, but you might be able to look at it for ideas or submit patches.

--Daniel

Replies are listed 'Best First'.
Re^2: Tail rotating logfiles with tie
by Brutha (Friar) on Oct 01, 2004 at 10:28 UTC
    Thank you for the hint, but I already looked at File::Tail. Tests fail under Windows, but to try minimum functinality this works.

    It also keeps the logfile open, which does not allow the logging program to rotate the file:

    Can't rename logfile to logfile.0: Permission denied

    And it came to pass that in time the Great God Om spake unto Brutha, the Chosen One: "Psst!"
    (Terry Pratchett, Small Gods)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://395375]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-03-29 13:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found