Project

General

Profile

[Solved] Mod_acceslog: Log succesful downloads

Added by abreemen over 6 years ago

For a project where I am one of the developers I am looking for a solution to log succesful downloads. I use mod_dirlisting to list the contents in a folder. People can download the files listed, and I am curious if I can log succesful downloads.

In mod_accesslog I have enabled some parameters that I think are useful, like connection status, bytes outgoing, physical filename, time used in seconds etc.

However, I see a lot of rows like:
FILENAME1 X 65431 1
FILENAME1 X 65431 1
FILENAME1 + 65431 1
FILENAME1 + 91222 1
FILENAME2 + 123211121 411
FILENAME2 + 123211121 450
FILENAME2 + 123211121 475

As you can see, I cannot use a simple SUM (which will result in 7 downloads) because in reality only two files were downloaded. In the lighttpd1 docs there is not much information about the different parameters. But in the lighttpd2 docs I saw that the connection status means "Connection status after response: “X” if aborted before completed, “+” if keepalive, “-” if no keepalive".

First I used the '+' status as a sign of a successful download, but as you can see the last 3 log rows are all '+' but still, it's only one request and one file. Also the time used is getting larger but the bytes stay the same.

So at this moment I am looking for some additional signs for a succesful download. I was thinking of maybe comparing the bytes outgoing with the amount of bytes of the original file, but this would create some additional scripts.

My question for now is: is there a simple way to detect a complete, unique, succesful download in lighttpd?


Replies (2)

RE: [Solved] Mod_acceslog: Log succesful downloads - Added by gstrauss over 6 years ago

Please read the documentation https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModAccesslog
See %b for bytes sent for body, and %o for response header. If sending a file, lighttpd sets Content-Length in response headers.

Do I get an 'A' on your homework assignment?

RE: [Solved] Mod_acceslog: Log succesful downloads - Added by abreemen over 6 years ago

My next step was enabling all options to see which option I could use for this, but thanks to your answer I will focous on %b and %o.

If I still was in school you would even get an extra sticker next to your `A` ;) Thanks for your time in the weekend!

    (1-2/2)