成都创新互联网站制作重庆分公司

nginx日志使用json输出

在nginx中使用json格式输出日志记录

从事郑州服务器托管,服务器租用,云主机,网络空间,空间域名,CDN,网络代维等服务。

log_format json '{ "time_local": "$time_local", '
'"remote_addr": "$remote_addr", '
'"referer": "$http_referer", '
'"request": "$request", '
'"status": $status, '
'"bytes": $body_bytes_sent, '
'"agent": "$http_user_agent", '
'"x_forwarded": "$http_x_forwarded_for", '
'"up_addr": "$upstream_addr",'
'"up_host": "$upstream_http_host",'
'"upstream_time": "$upstream_response_time",'
'"request_time": "$request_time"'
' }';

access_log /var/log/nginx/access.log json;

对于使用filebeat来收集日志很重要。


网站标题:nginx日志使用json输出
标题路径:http://cxhlcq.com/article/jhghii.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部