Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to keep some statics about the files uploaded to my server, including the file name, size and response time.

I use PHP to handle the uploads in the server side (client-side is a POST form) but ideally I'd like to use Apache's logging facilities to collect the above-mentioned data. So, I'm trying to modify the default format for the access_log but I only found how to add the response time (using the %D formatter).

Is it possible to use Apache logs to monitor at least the size of POST requests and if possible the filenames of the uploaded files?

share|improve this question
up vote 2 down vote accepted

As per the Apache documentation you want %I and mod_logio:

%I  Bytes received, including request and headers, cannot be zero. You need to enable mod_logio to use this.
%O  Bytes sent, including headers, cannot be zero. You need to enable mod_logio to use this.
share|improve this answer
Thanks, this is good for the upload size. The only problem remaining to solve is how to get the file name. – Vasilis Jan 7 '13 at 12:29
@Vasilis - this probably won't be possible from Apache itself, as it doesn't have any knowledge of what it inside the multipart upload. Determining the request size inc. headers is trivial, which is why it can do that. But for the filenames themselves, you will have to write some server-side logic to do that. E.g. you can combine form elements with files, or multiple files, or all sorts of things that Apache can't be expected to know what to do with. – Mark Henderson Jan 8 '13 at 2:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.