Don't log 404 error

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Don't log 404 error

Vincent M.

Hello,

How not to log 404 errors:

2019/10/29 12:42:09 [error] 469#469: *16382 open() "/var/www/website/fr/telecharger" failed (2: No such file or directory),

In my config I have:

error_log /var/log/nginx/website-error.log;

Because I use 404 for doing url rewriting and so they are not errors...

error_page 404 = /url_rewriting.php;


Thanks,
Vincent.


_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Don't log 404 error

Sergey Kandaurov

> On 29 Oct 2019, at 15:45, Vincent M. <[hidden email]> wrote:
>
> Hello,
>
> How not to log 404 errors:
>
> 2019/10/29 12:42:09 [error] 469#469: *16382 open() "/var/www/website/fr/telecharger" failed (2: No such file or directory),
>
> In my config I have:
>
> error_log /var/log/nginx/website-error.log;
>
> Because I use 404 for doing url rewriting and so they are not errors...
>
> error_page 404 = /url_rewriting.php;
>

http://nginx.org/r/log_not_found

--
Sergey Kandaurov

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Don't log 404 error

Vincent M.
Le 29/10/2019 à 13:59, Sergey Kandaurov a écrit :

      
On 29 Oct 2019, at 15:45, Vincent M. [hidden email] wrote:

Hello,

How not to log 404 errors:

2019/10/29 12:42:09 [error] 469#469: *16382 open() "/var/www/website/fr/telecharger" failed (2: No such file or directory),

In my config I have:

error_log /var/log/nginx/website-error.log;

Because I use 404 for doing url rewriting and so they are not errors...

error_page 404 = /url_rewriting.php;

http://nginx.org/r/log_not_found

Yes perfect! So easy. Sorry didn't think that would be so easy within an option.


_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx