How to write in access.log only logs with 200 status and all the rest in error.log?
use the ispmanager control panel 5. (ubuntu 14 + nginx+php-fpm, php 5). recently put on a new server the same ispmanager 5 + 16 ubuntu and php 7. revealed this problem: for some reason the logs of the treatment sites in most cases were written in access.log.
Let me explain. If earlier on the old server, let's say the 401 is always written in error.log, now, such errors are written in access.log. How to change this? And preferably just leave it in access.log only a specific status (for example, 200, 301, 302 etc)
Judson.Williamson answered on July 2nd 19 at 17:11
It does not answer the question.
Don't do like you want.
Error log exists for the cloning errors that you must correct and to prevent re-occurrence.
The Access log is intended for logging of all responses from the server worked WITHOUT errors. 404, 301/302, etc is valid from the point of view of web server responses and their is no need to classify erroneous.
You would be better to use the tools to work with logs, in order to work with access.log and filter only the desired messages. There are tools, from grep to ELK.
meda_Gibson61 answered on July 2nd 19 at 17:13
If you leave out a why you need it, the solution is simple enough: