views:

40

answers:

1

I need a way to log an entry into a database, everytime a particular file is requested from the server. The file can be any type, even images or other media.

Is it also possible to log which IP address or hostname has requested that file?

+2  A: 

What's the language? HTTP handler technology?

Example: java/servlet, ruby/rails, php/apache...

In either case you can analyze the log file easily: HTTP log files contain ip, file name, timestamp.

It would be a ten lines in perl+DBI to parse apache's config and count downloads into database. Stuck it int cron and be done.

alamar
Any language. Basically it should be standalone since I'm not running any server side scripts currently.
Jenko
Parse the HTTP log.
alamar
Can you read server logs in PHP?
Jenko
Yes you can. Why don't you grab awstats, btw? Google for it.
alamar