Nginx lua日志位置

标签 nginx lua

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/

相关文章:

node.js - nginx 上的代理传递 Socket.IO 连接不起作用

node.js - 使用 Node.js 和 Nginx 进行负载平衡长轮询请求

c++ - Lua 用户数据对象管理

c++ - 如何使用 Lua 从表中的表中获取值?

machine-learning - 停止梯度更新架构中子网络的权重

javascript - nginx 拒绝访问 JS 和 CSS

基于数据库查找的nginx动态proxy_pass

php - nginx 上的 Laravel 权限

lua - 我如何在 Corona 和 Lua 中使用 "id = tostring(i) "

lua - 在 Lua 中重新定义变量的类型