PHP记录对特定文件的请求[关闭]

I need to log all requests for a particular image file, example: awesome.png I found some solutions like requesting a php file which will log the request then serve the image file, but that's not what i want...i want to directly request the image file example: www.mysite.com/awesome.png

I searched all over ineternet but can't find a solution. I will be very thanksful if you give me some hints.

PS: I KNOW APACHE IS ALREADY LOGGING IT...BUT I WANT CREATE MY OWN CUSTOM LOGGING SCRIPT!

Thanks

As Jeoren said, this is already logged by your web server. Find your web server's log and run this command from the terminal on the file:

grep "www.mysite.com/awesome.png" apache.log

Alternatively, the other solution is right. You'll need to create a php file that you pass the image file name to. Then, the PHP file would log the attempt to load the image, file the file by name, and stream it to the end user.