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

Re: Removing old records from log files

by Zaxo (Archbishop)
on Aug 22, 2001 at 14:21 UTC ( #106907=note: print w/ replies, xml ) Need Help??


in reply to Removing old records from log files

With that rate of logging, you are likely to need locks the logger respects to modify the file in place. Given that, a binary search strategy will speed your search for the cutoff time. RecursivelyIteratively estimate the location of the first record you want to keep.

Another approach would be to set up a cron job renaming the log file out of the way at set times. You may have a system utility called logrotate which specializes in that.

Update: Oops :-)

After Compline,
Zaxo


Comment on Re: Removing old records from log files
Download Code
Re: Re: Removing old records from log files
by claree0 (Hermit) on Aug 22, 2001 at 14:31 UTC

    Luckily, locks are not an issue (see above). The binary searchstrategy, however, does sound like a good idea!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2014-12-22 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (115 votes), past polls