天天看点

nginx访问日志格式

$time_iso8601 ISO8601标准格式下的本地时间。

$time_local 通用日志格式下的本地时间。

我们在配置访问日志的时候,一般都是按照默认格式,但是我觉得$time_local换成$time_iso8601更直观一些。

log_format  main  '$remote_addr - $remote_user $time_iso8601  "$request" '

                         '$status $body_bytes_sent "$http_referer" '

                         '"$http_user_agent" "$http_x_forwarded_for"';

access_log  logs/access.log  main;

本文转自chenzudao51CTO博客,原文链接: http://blog.51cto.com/victor2016/1885385,如需转载请自行联系原作者

继续阅读