Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does nginx store the rewrite_log?

When you turn on the nginx rewrite log with rewrite_log on;, where does the system actually log that info? It doesn't seem to be in the documentation, and a decent search through google doesn't turn anything up.

I have also tried enabling and looking in both the access and error logs. No luck.

like image 816
kenny Avatar asked Mar 28 '12 02:03

kenny


People also ask

Where nginx logs are stored?

By default, the Nginx access log is located at /var/log/nginx/access. log and the error log is located at /var/log/nginx/error. log . Nginx logs file default path depends on the operating system and installation.

How long are Nginx logs kept?

You can set up logrotate for nginx, in this way you can maintain logs for 30 days or more as per your requirements !

How do I access nginx logs?

Configure NGINX access log By default, the access log is located at /var/log/nginx/access. log , and the information is written to the log in the predefined combined format. You can override the default settings and change the format of logged messages by editing the NGINX configuration file ( /etc/nginx/nginx.

What is the format of Nginx logs?

The default log format in nginx is called "combined".


1 Answers

If rewrite_log on; is used then the rewrite information will be logged to error_log at notice level. There is no separate log file.

like image 66
Moritz Bunkus Avatar answered Oct 02 '22 13:10

Moritz Bunkus