– JSON格式
-
如何在Nginx中配置以JSON格式记录日志?
在nginx中,使用JSON格式记录日志的配置示例如下:,,“,http {, log_format json_combined escape=json ‘{ “@timestamp”: “$time_iso8601”, “host”: “$remote_addr”, “clientip”: “$remote_addr”, “size”: $body_bytes_sent, “responsetime”: “$request_time”, “upstreamtime”: “$upstream_response_time”, “url”: “$uri”, “method”: “$request_method”, “status”: “$status”, “http_referer”: “$http_referer”, “http_user_agent”: “$http_user_agent”}’;, access_log /var/log/nginx/access.log json_combined;,},“