Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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
Replies are listed 'Best First'.
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 contemplating the Monastery: (4)
As of 2015-07-30 02:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls