How to turn off the log function in nginx

王林
Release: 2020-08-20 16:50:01
forward
10048 people have browsed it

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;
Copy after login

or

access_log /dev/null;
Copy after login

2. Close Server operation log:

error_log /dev/null;
Copy after login

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
Copy after login

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

ps -ef|grep delete kill -9 pid
Copy after login

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!