From a2cfbc5519a198ed3264113df9ca54f53d0217fa Mon Sep 17 00:00:00 2001 From: Tan Jiang Date: Wed, 29 Mar 2017 18:51:40 +0800 Subject: [PATCH] update nginx log format to include response time --- make/common/templates/nginx/nginx.http.conf | 6 ++++++ make/common/templates/nginx/nginx.https.conf | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/make/common/templates/nginx/nginx.http.conf b/make/common/templates/nginx/nginx.http.conf index 980d9ece2..b776f7436 100644 --- a/make/common/templates/nginx/nginx.http.conf +++ b/make/common/templates/nginx/nginx.http.conf @@ -21,6 +21,12 @@ http { server ui:80; } + log_format timed_combined '$$remote_addr - ' + '"$$request" $$status $$body_bytes_sent ' + '"$$http_referer" "$$http_user_agent" ' + '$$request_time $$upstream_response_time $$pipe'; + + access_log /dev/stdout timed_combined; server { listen 80; diff --git a/make/common/templates/nginx/nginx.https.conf b/make/common/templates/nginx/nginx.https.conf index 141961ecf..131aec466 100644 --- a/make/common/templates/nginx/nginx.https.conf +++ b/make/common/templates/nginx/nginx.https.conf @@ -21,6 +21,13 @@ http { server ui:80; } + log_format timed_combined '$$remote_addr - ' + '"$$request" $$status $$body_bytes_sent ' + '"$$http_referer" "$$http_user_agent" ' + '$$request_time $$upstream_response_time $$pipe'; + + access_log /dev/stdout timed_combined; + include /etc/nginx/conf.d/*.server.conf; server {