“Nginxlog关闭”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
(创建页面,内容为“ == <pre> 可以修改nginx.conf 找到access_log: access_log /dev/null; access_log off; error_log /dev/null; 这样全部把他们丢到系统的黑洞里了…”)
(没有差异)

2020年4月8日 (三) 03:22的版本

==

可以修改nginx.conf 找到access_log:

access_log /dev/null;
access_log off;
error_log /dev/null;

这样全部把他们丢到系统的黑洞里了
不用每时每刻都往系统磁盘疯狂的读写日志了 还延长硬盘的寿命


修改完,重启Nginx( kill -HUP `cat logs/nginx.pid` )即可。


NOTE
access_log 可以off,error_log 不能off,可以丢到/dev/null 里。

Nginx关闭日志

nginx access_log 完全关闭