# Stingy (filehandles) # In this example # All images are logged seperately, and the file is kept open # Some rare file-types are logged seperately, with immediate closure # NOTE: While this example is uses simple as a base for ease of comprehension, # it would be more useful with a large number of medium to # low traffic logs. e.g. Many many virtualhosts %FILES= ( # Images are buffered (who cares about them? ;-) IMAGES=>[">>/var/log/httpd/images.log"], # Everything else is not PS =>[">>/var/log/httpd/postscript.log", 1], PDF =>[">>/var/log/httpd/pdf.log", 1], CATCH =>[">>/home/httpd/logs/access.log", 1] ); Flog::init(); sub flog{ # Return if you do not wish to duplicate data across logs # Pass printFlog a filehandle to open, and optional true value to close it return printFlog(PDF, 1) if m%\.pdf %; return printFlog(PS, 1) if m%\.ps %; return printFlog(IMAGES,1 ) if m%\.(gif|jpg|png) %; printFlog(CATCH); } 1;