您现在的位置是:亿华云 > IT科技类资讯

如何格式化日志并推送到远程服务器?看完原来很简单!!

亿华云2025-10-08 23:30:22【IT科技类资讯】8人已围观

简介复制log_formatcommon"$remote_addr,$http_ip,$http_mac,$time_local,$status,$request_length,$bytes_sent,$

如何格式化日志并推送到远程服务器?看完原来很简单!!
复制log_format common "$remote_addr,何格$http_ip,$http_mac,$time_local,$status,$request_length,$bytes_sent,$body_bytes_sent,$http_user_agent,$http_referer,$request_method,$request_time,$request_uri,$server_protocol,$request_body,$http_token";  log_format main "$remote_addr,$http_ip,$http_mac,$time_local,$status,$request_length,$bytes_sent,$body_bytes_sent,$http_user_agent,$http_referer,$request_method,$request_time,$request_uri,$server_protocol,$request_body,$http_token";  access_log  logs/access.log  common;  access_log syslog:server=192.168.1.100:9999,facility=local7,tag=nginx,severity=info main;    map $http_upgrade $connection_upgrade {       default upgrade;      close;   }   1.2.3.4.5.6.7.8.9.10.11.

很赞哦!(85)