The preface introduces the access log and error log under Apache server. View and simple analysis then this article describes the two kinds of log views on the Nginx server.
Find Log Store Address
Find/-name nginx.conf
According to the address you find out, dedicated VI edit, into the nginx.conf file to find the path
Vi/usr/servers/nginx/conf/nginx.conf
In order to find, I machine two log storage location:/var/logdata/nginx/access.log/var/logdata/nginx/error.log
View Access Access logs
Vi/var/logdata/nginx/access.log
Access log Analysis A partial result:
100.109.195.91--[17/feb/2017:00:08:11 +0800] "get/data/upload/shop/common/loading.gif http/1.0 134" http:// www.mall121.com/"" mozilla/4.0 (compatible; MSIE 8.0; trident/4.0; Windows NT 6.1; SLCC2 2.5.5231;. NET CLR 2.0.50727;. NET CLR 4.1.23457;. NET CLR 4.0.23457; Media Center PC 6.0; MS-WK 8) "" 140.205.201.12 "100.109.195.78--[17/feb/2017:00:08:11 +0800]" get/shop/templates/default/images/ U-safe.png http/1.0 "3675" http://www.mall121.com/"mozilla/4.0 (compatible; MSIE 8.0; trident/4.0; Windows NT 6.1; SLCC2 2.5.5231;. NET CLR 2.0.50727;. NET CLR 4.1.23457;. NET CLR 4.0.23457; Media Center PC 6.0; MS-WK 8) "" 140.205.201.12 "100.109.195.26--[17/feb/2017:00:08:11 +0800]" get/data/upload/shop/adv/ 05240495346955824.jpg http/1.0 "404 564" http://www.mall121.com/"mozilla/4.0 (compatible; MSIE 8.0; trident/4.0; Windows NT 6.1; SLCC2 2.5.5231;. NET CLR 2.0.50727;. NET CLR 4.1.23457;. NET CLR 4.0.23457; Media Center PC 6.0; MS-WK 8) "140.205.201.12"
1.100.109.195.91: $remote _addr: Client (user) IP address 2. [17/feb/2017:00:08:11 +0800]: $time _local: Access time 3. " Get/data/upload/shop/common/loading.gif http/1.0 ":" $request "GET request URL address (destination URL address) host 4.200: ' $status request status (status code, 200 means success, 404 means that the page does not exist, 301 permanent Redirect, etc., the specific status code can find relevant articles on the Internet, no longer repeat the 5. 134: $body _bytes_sent: Request page size, default to B (Byte 6.) http://www.mall121.com/":" $http _referer ": Source page, that is, from which page to go to this page, the professional name is called" Referer "7. mozilla/4.0 (compatible; MSIE 8.0; trident/4.0; Windows NT 6.1; SLCC2 2.5.5231;. NET CLR 2.0.50727;. NET CLR 4.1.23457;. NET CLR 4.0.23457; Media Center PC 6.0; MS-WK 8) ": $http _user_agent: User browser Other information, browser version, browser type 8. "140.205.201.12": $http _x_forwarded_for "
or through the configuration in the Nginx configuration file, in a different format:
Log_format Main ' $remote _addr-$remote _user [$time _local] '
fwf[$http _x_forwarded_for] tip[$http _true_client_ip ] '
$upstream _addr $upstream _response_time $request _time '
$geoip _country_code '
$http _host $request ' "
$status" $body _bytes_sent "$http _referer" "
$http _accept_language" "$http _user_agent";
1. Client (user) IP address. 2. Visit time. 3. Access Port. 4. Response time. 5. Request time. 6. User Location Code (country code). 7. Host of the requested URL address (destination URL address). 8. Request method (get or post etc.). 9. Request URL address (remove host part). 10. Request Status (status code, 200 indicates success). 11. Request page size, default to B (Byte). 12. Source page, that is, from which page to go to this page, the professional name is called "Referer." 13. User Browser language. such as: "es-es,es;q=0.8" in the example above 14. User browser Other information, browser version, browser type, and so on.
Error log Similarly,
Vi/var/logdata/nginx/error.log
There are no more details about the error log view.
Related articles: Error_log and Access_log analysis of Nginx: http://blog.csdn.net/fangru/article/details/9128699
System log: Record system related information: http://blog.csdn.net/ty_hf/article/details/55511624 Apache access logs and error logs: http://blog.csdn.net/ty_hf/ article/details/55504719 nginx access log and error log: http://blog.csdn.net/ty_hf/article/details/55518070 php-fpm slow Log : Detect slow PHP script: http://blog.csdn.net/ty_hf/article/details/55504172 PHP error log: Detects PHP run or user logs error log: http:// blog.csdn.net/ty_hf/article/details/55505262 MySQL slow log: Record the performance sql:http://blog.csdn.net/ty_hf/article/in the MySQL server details/55504172
This article address: http://blog.csdn.net/ty_hf/article/details/55518070