# Nginx日志管理
我們觀察Nginx的server段,可以看到如下內容:
`#access_log logs/access.log main;
`
參數一:配置名
參數二:指定訪問日志的文件是`logs/access.log`
參數三:使用的日志格式"main"格式。同時我們也可以通過log_format配置其他格式的日志記錄方式。
~~~
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
~~~
另外和其他的web服務器一樣,nginx可以針對不同的server配置不同的log