我在我的项目中使用NGINX Openresty(版本1.4.3.4),我想知道我是否可以使访问日志对齐。
来自:
[06/Mar/2015:21:20:11 +0000] [0.028] [200] [54.162.222.95] ["GET /XXX"]
[06/Mar/2015:21:20:11 +0000] [0.020] [200] [108.177.223.182] ["GET /XXX"]
[06/Mar/2015:21:20:11 +0000] [0.022] [204] [208.43.79.196] ["POST /XXX"]
[06/Mar/2015:21:20:11 +0000] [0.018] [204] [173.192.139.113] ["GET /XXX"]
[06/Mar/2015:21:20:11 +0000] [0.019] [200] [54.152.215.46] ["GET /XXX"]
看起来像这样
[06/Mar/2015:21:20:11 +0000] [0.028] [200] [54.162.222.95] ["GET /XXX"]
[06/Mar/2015:21:20:11 +0000] [0.020] [200] [108.177.223.182] ["GET /XXX"]
[06/Mar/2015:21:20:11 +0000] [0.022] [204] [208.43.79.196] ["POST /XXX"]
[06/Mar/2015:21:20:11 +0000] [0.018] [204] [173.192.139.113] ["GET /XXX"]
[06/Mar/2015:21:20:11 +0000] [0.019] [200] [54.152.215.46] ["GET /XXX"]
目前我的设置是:
log_format normal '[$time_local] [$request_time] [$status] [$http_x_forwarded_for] ["$request"]';
感谢。