Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

up vote 1 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

 
discard

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.