Make sure that :
1) your files and scripts are created in UTF-8,
2) your server sends these files to UTF-8
3) you are viewing the web server logs in a terminal that supports UTF-8
4) UTF-8 support is installed on your server
You can download the web server logs, open them in a text editor and see what encoding it recognizes. If everything is readable and the editor shows the UTF-8 encoding, then you have a problem with the terminal.
Modern browsers by default work in UTF-8, so first check it out, and if you have a specific case when you send requests from a page encoded in cp1251, you probably need to use the answer @Alex Krass
https://tomcat.apache.org/tomcat-8.0-doc/logging.html , for example, says that tomcat saves logs in the system encoding by default. there is an instruction for switching logging to log4j with utf8