Need log the who downloaded attachments

I have a idea, use

script/nginx_analyze.rb

can help me add the code ? Output all zip and rar url User access Filename + username.

So I know who downloaded it.