简体   繁体   English

Nginx lua 日志位置

[英]Nginx lua log location

The Nginx lua module has a logging method : Nginx lua 模块有一个记录方法

 ngx.log(ngx.NOTICE, "hello world")

However, the docs don't indicate where this is logged to.但是,文档没有指明这是记录到哪里。 Does it depend on the level param, ie ngx.ERROR would be in error log, while ngx.NOTICE would be in access log?它是否取决于级别参数,即 ngx.ERROR 将在错误日志中,而 ngx.NOTICE 将在访问日志中? Or some other file that needs to be configured?或者其他一些需要配置的文件?

I've added a log with ngx.INFO and not seeing anything appear in the logs folder.我添加了一个带有ngx.INFO的日志,但在日志文件夹中没有看到任何内容。

It says exactly the next line: 它说的正是下一行:

Log arguments concatenated to error.log with the given logging level. 日志参数以给定的日志记录级别连接到error.log。

You should be looking into nginx's error.log . 您应该查看nginx的error.log It's configured using nginx conf: 它是使用nginx conf配置的:

// example
error_log  logs/error.log error;

error_log 日志\/error.log 调试;

"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM