Heim  >  Artikel  >  Backend-Entwicklung  >  nginx日志如何输出某变量

nginx日志如何输出某变量

WBOY
WBOYOriginal
2016-08-04 09:19:054150Durchsuche

代码是php,跑在nginx上,有一部分是发邮件的功能
为了方便调试,想输出某个变量看,
但是不知道输出到哪里,怎么输出?
node里可以直接console.log(),但是nginx上的php怎么输出?
网上说是改log format,还有用echo?
不太明白,是可以直接echo?那输出到了哪里?
请大家指点一下,

回复内容:

代码是php,跑在nginx上,有一部分是发邮件的功能
为了方便调试,想输出某个变量看,
但是不知道输出到哪里,怎么输出?
node里可以直接console.log(),但是nginx上的php怎么输出?
网上说是改log format,还有用echo?
不太明白,是可以直接echo?那输出到了哪里?
请大家指点一下,

nginx日志记录的话不是使用php来输出的,你应该是要去修改nginx/conf/ngnix.conf文件
更改 log_format 后面的格式,不同的参数对应不同的值你可以 看下

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn