Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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'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


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

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.