Home  >  Article  >  Backend Development  >  How to output a certain variable in nginx log

How to output a certain variable in nginx log

WBOY
WBOYOriginal
2016-08-04 09:19:054200browse

The code is PHP, running on nginx, and part of it is the function of sending emails.
In order to facilitate debugging, I want to output a certain variable,
but I don’t know where to output it, and how to output it?
You can console.log() directly in node, but how to output it in php on nginx?
On the Internet, it says that the log format is changed. Can I still use echo?
I don’t quite understand. Can I echo it directly? Where is the output?
Please give me some advice,

Reply content:

The code is PHP, running on nginx, and part of it is the function of sending emails.
In order to facilitate debugging, I want to output a certain variable,
but I don’t know where to output it, and how to output it?
You can console.log() directly in node, but how to output it in php on nginx?
On the Internet, it says that the log format is changed. Can I still use echo?
I don’t quite understand. Can I echo it directly? Where is the output?
Please give me some advice,

nginx log records are not output using php. You should modify the nginx/conf/ngnix.conf file
Change the format behind log_format. Different parameters correspond to different values. You can take a look

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn