Home > Article > Backend Development > How to output a certain variable in nginx log
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,
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