Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Log4perl log rotation in threadpool environment

by rmahin (Beadle)
on Nov 16, 2012 at 18:29 UTC ( #1004229=note: print w/ replies, xml ) Need Help??


in reply to Re: Log4perl log rotation in threadpool environment
in thread Log4perl log rotation in threadpool environment

Thanks! That was my original idea actually but wasnt aware I could erase (truncate was apparently the word I should have search on) the contents of the file with file handle open. Changed my obnoxious swapping code to

copy($currFile, $logDir. $self->{old_logs_name}. '.1') or die +"Could not copy the log file because $!"; my $fh = $self->{fh}; truncate($fh, 0) or die "Could not truncate the log file becau +se $!"; seek($fh, 0, 0) or die "Could not set the position in the log +file because $!";
Thanks again!


Comment on Re^2: Log4perl log rotation in threadpool environment
Download Code
Re^3: Log4perl log rotation in threadpool environment
by space_monk (Chaplain) on Nov 17, 2012 at 17:51 UTC
    Another satisfied customer :-)
    A Monk aims to give answers to those who have none, and to learn from those who know more.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2014-07-31 10:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (248 votes), past polls