Home  >  Article  >  Operation and Maintenance  >  How to turn off the log function in nginx

How to turn off the log function in nginx

王林
王林forward
2020-08-20 16:50:0110139browse

How to turn off the log function in nginx

nginx Turn off the log; in fact, one way is to write the /dev/null file or set it to turn off.

(Recommended tutorial: nginx tutorial)

nginx logs have two types:

access.log http records access logs.

error.log server operation record log

1. Close http record access log

access_log off;

or

access_log /dev/null;

2. Close Server operation log:

error_log /dev/null;

Clear the log of the occupying program;

nginx or tomcat or other occupying program clear the log;

cat /dev/null > test.log
或
echo " " > test.log

Direct rm deletion will cause the space not to be released ;

ps -ef|grep delete
kill -9 pid

The above is the detailed content of How to turn off the log function in nginx. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete