Nginx lua 模块有一个 logging method :
ngx.log(ngx.NOTICE, "hello world")
但是,文档没有指出记录到哪里。它是否取决于级别参数,即 ngx.ERROR 将在错误日志中,而 ngx.NOTICE 将在访问日志中?或者需要配置其他一些文件?
我使用 ngx.INFO
添加了日志,但在日志文件夹中没有看到任何内容。
最佳答案
它准确地说了下一行:
Log arguments concatenated to error.log with the given logging level.
您应该查看 nginx 的 error.log
。它是使用 nginx conf 配置的:
// example
error_log logs/error.log error;
关于Nginx lua日志位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56574355/