Nginx combined log format and parameter explanation

Because lnmp does not customize the log format by default, it uses the combined default format:

'$remote_addr - $remote_user  [$time_local]  '
' "$request"  $status  $body_bytes_sent  '
' "$http_referer"  "$http_user_agent" ';

Parameter explanation:

  • $remote_addr, $http_x_forwarded_for
    record the client IP address.
  • $remote_user
    records the client user name.
  • $request
    records the requested URL and HTTP protocol.
  • $status
    records the status of the request.
  • $body_bytes_sent
    the number of bytes sent to the client, not including the size of the response header.
  • $http_referer
    records which page link is visited from.
  • $http_user_agent
    records information about the client browser.
  • $bytes_sent
    the total number of bytes sent to the client.
  • $connection
    the serial number of the connection.
  • $connection_requests
    the number of requests currently obtained through a connection.
  • $msec
    log write time. The unit is seconds and the precision is milliseconds.
  • $pipe
    if the request is sent via HTTP pipelined, the pipe value is “p”, otherwise it is “.”.
  • $request_length
    the length of the request (including request line, request header and request body).
  • $request_time
    request processing time, the unit is seconds, the precision is milliseconds.
  • $time_iso8601
    the local time in the ISO8601 standard format.
  • $time_local
    the local time in the common log format.

Add a Comment

Your email address will not be published. Required fields are marked *