I am working on a webapp containing several hundred scripts, many of which are no longer being used. I would like to record normal usage patterns to determine what to get rid of,and what to optomize. Toward this end I would like to generate some statistics and insert them into a logfile every time a program is run... such as program name, execution time, timestamp, etc.
I can get some of this from the apache logs, but there are a lot that are run from crontab and called from other scripts. Is there a way to turn on some form of logging in perl, or have it run a script before and after each program is executed?