Nginx 关闭日志生成文件

nginx 关闭日志;其实一种方法就是写入/dev/null 文件 或者设置关闭;

nginx 日志有两个类型 

access.log  http 记录访问日志。

error.log   server 操作记录日志

1、关闭 http 记录访问日志
access_log off;

access_log /dev/null;
2、关闭 server 操作日志: error_log /dev/null;

清空 占用程序的日志;

nginx或者tomcat 或者其他占用程序 清除日志;
cat /dev/null > test.logecho " " > test.log

直接 rm  删除 导致空间不释放;

ps -ef|grep delete
kill -9 pid 
原文地址:https://www.cnblogs.com/sharesdk/p/9845462.html