Introduction to Nginx Log format

Source: Internet
Author: User

First, Introduction

The format of the log file in Nginx is defined in nginx.conf, and its default format is as follows:

#vim/usr/local/nginx/conf/nginx.conf
Log_format access ' $remote _addr– $remote _user [$time _local] "$request" ' $status $body _bytes_sent ' $http _referer ' "$ Http_user_agent "$http _x_forwarded_for";

Where the meaning of each field is as follows:

1. $remote _addr and $http_x_forwarded_for used to record the IP address of the client;
2. $remote _user: Used to record the client user name;
3. $time _local: Used to record access time and time zone;
4. $request: The URL used to record the request and the HTTP protocol;
5. $status: Used to record request status; Success is 200.
6. $body _bytes_s ent: Records sent to the client file body content size;
7. $http _referer: Used to record links from the page to visit;
8. $http _user_agent: Record the relevant information of the client browser;


References: http://www.linuxidc.com/Linux/2012-12/75658.htm


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.