当前位置:   article > 正文

linux查看log日志在哪,如何查看linux的系统log日志

linux输出service服务log到哪里

1.查看系统日志所存放的位置

通过nginx的配置文件查看 default 。

access_log /var/log/nginx/hej.access.log common;

2.查看系统日志的格式

通过nginx的配置文件查看 nginx.conf。(如果是apache,对应找到httpd文件)

log_format apinpai '$remote_addr $host - [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent"';

3.通过命令进入日志

cd /var/log/nginx/

4.查看日志 访问前十的 信息

cat hej.access.log | awk '{print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11}' | sort | uniq -c | sort -nr | head -10cat hejian.access.log

| awk '{print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11}' | sort | uniq -c | sort -nr | head -10

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/204657
推荐阅读
相关标签
  

闽ICP备14008679号