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'm changing my server from Apache to Nginx. Nginx will only serve static files and proxy to apache for dynamic files and to NodeJS for exhausting working. With my initial implementation in Apache I have some custom log to get informed of how many data I send and receive.

CustomLog /var/log/apache2/traffic-access.log "%{%s}t|%O|%I|%{Referer}i|%a|%U"

This custom log generate this log example:

Timestamp|bytes sent|bytes received|user agent|IP|URL request

1335941116|261|322|user-4263|127.0.0.1|/1.1/user/downloading

I would like to migrate this custom log to Nginx and try to change the less as I can my internal scripts of getting traffic data.

I want to maintain the 2 logs the main log and traffic log.

I'm starting with this custom log:

http {
[...]

log_format traffic '$msec|$bytes_sent|$request_length???|$http_user_agent|$remote_addr|$request_filename';

access_log  logs/access.log  main;
access_log  logs/traffic.log traffic

Is the request_length the bytes user send to the server?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Yes, the $request_length is the length of the body of the request sent by user to the server. You can visit this link for other values.

share|improve this answer
add comment

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.