June 14, 2020 01:02PM
That clears it up. Most of what I see in the error log is stuff I have no idea how to fix. I will Google some errors and see what is fixable. The deal is my websites work for me and I get no complaints.

Reading questions on the interwebs, most people get error messages when they use curl on their website. Now I never saw a post where someone intentionally causes an error with curl, but why not. Basically use curl to do something a bad browser would do.

Oh yeah I trap curl too. I used to see strange stuff in the log file from curl use so I put it in the map.

Maybe there is a test suite for this on GitHub.





  Original Message  


From: c@tunnel53.net
Sent: June 14, 2020 8:34 AM
To: nginx@nginx.org
Reply-to: nginx@nginx.org
Subject: Re: Force Nginx to log error?


> I'm not sure I understand the question, but how does this sound? I
> use a map to catch requests that I don't want. For instance I return
> a 444 if I receive a "wget".

No, I don’t mean status codes on the HTTP level. Status code 444 is
not an error per se that would be sent to the error log, it is a valid
status code sent from the server to the client. To the client that
might be considered an error, but not to Nginx.

I mean errors on a lower level, i.e. the level of the nginx daemon
itself.

E.g. stuff like this:

2020/06/14 13:13:59 [alert] 700#700: *998 open socket #13 left in connection 11
2020/06/14 13:13:59 [alert] 700#700: *4118 open socket #4 left in connection 13
2020/06/14 13:13:59 [alert] 700#700: *4169 open socket #17 left in connection 16
2020/06/14 13:13:59 [alert] 700#700: aborting

It would be useful to me to be able to trigger such messages, so that
I can verify that they are sent to the right destination.

E.g. if I have the following stanza in my config:

error_log /srv/nginx/error.log warn;

Then messages of the warn/error/crit/alert/emerg levels should be
logged and written to the file /srv/nginx/error.log (a file which is
separate from the access log).

I hope it is clearer now what I meant :)
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Force Nginx to log error?

Carl Winbäck June 14, 2020 08:42AM

Re: Force Nginx to log error?

gariac June 14, 2020 09:54AM

Re: Force Nginx to log error?

Carl Winbäck June 14, 2020 11:36AM

Re: Force Nginx to log error?

Carl Winbäck June 20, 2020 04:08AM

Re: Force Nginx to log error?

gariac June 14, 2020 01:02PM

Re: Force Nginx to log error?

J.R. June 14, 2020 05:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 84
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready