从服务器请求文件时记录

时间:2022-12-21 13:29:19

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?

是否也可以记录哪个IP地址或主机名已请求该文件?

1 个解决方案

#1


What's the language? HTTP handler technology?

这是什么语言? HTTP处理技术?

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

示例:java / servlet,ruby / rails,php / apache ...

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

在任何一种情况下,您都可以轻松分析日志文件:HTTP日志文件包含ip,文件名,时间戳。

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.

perl + DBI中的十行将解析apache的配置并将下载计入数据库。坚持到cron并完成。

#1


What's the language? HTTP handler technology?

这是什么语言? HTTP处理技术?

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

示例:java / servlet,ruby / rails,php / apache ...

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

在任何一种情况下,您都可以轻松分析日志文件:HTTP日志文件包含ip,文件名,时间戳。

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.

perl + DBI中的十行将解析apache的配置并将下载计入数据库。坚持到cron并完成。