现在监控工具很多,常用的有zabbix、nagios、云监控等,如果做性能分析,我比较推荐的是goaccess,它可以将日志文件生成html页面,以供我们分析。
$ yum -y install goaccess
二、在nginx中开启日志功能,并指定其格式
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" "$request_time" "$upstream_response_time" "$http_cookie" request_body&&&&&$request_body'; access_log logs/access.log main;
三、goaccess服务的配置文件内容
time-format %T date-format %d/%b/%Y log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u" %^ "%T" %^ %^ %^
四、将nginx 的访问日志转化成html

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/210400.html原文链接:https://javaforall.net
