in reply to Delete files by clock
Use Log::Log4perl with Log::Dispatch::FileRotate and make sure you rotate your files every 48 hours. That way you can be sure all lines in a file are written within the wanted 48 hour timespan.