How to close the error_log log in nginx

02-05-2023

Most people do not understand the knowledge points of this article on how to close the error_log log in nginx, so the editor summarizes the following content for you. The content is detailed, the steps are clear, and it has certain reference value. I hope you can read this article. The article can be rewarding. Let's take a look at this article on how to close the error_log log in nginx.

Configuration parameter format: error_log /path/to/log level;

Nginx error Log level

Common error log levels are debug | info | notice | warn | error | crit | alert | emerg

The higher the level, the less information recorded, if not defined, the default level is error.

It can be configured in main, http , server, and location sections.

If two error_logs are defined in the configuration file, there will be conflicts in the same configuration section, so only one error_log is allowed in the same section.

However, it is no problem to appear in different configuration sections.

Nginx error log example

error_log /var/log/nginx/error.log crit;

If you want to completely close the error_log, you need to configure it like this

error_log /dev/null;

The above is about how nginx closes the error_log I believe that everyone has a certain understanding of the content of this article in the diary. I hope that the content shared by the editor will be helpful to everyone. If you want to know more relevant knowledge content, please pay attention to the Yisu cloud industry information channel.

Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us