Hello!
2012/10/28 朱茂海:
> nginx的错误等级为notice,现在把ngx.NOTICE改为ngx.ERR就正常了,但是ngx.NOTICE不是包含ERR吗?
>
可以尝试下面这个最简单的例子:
error_log logs/error.log notice;
http {
server {
location /t {
content_by_lua '
ngx.log(ngx.NOTICE, "hello")
';
}
}
在我这里访问 /t 接口可以在 logs/error.log 文件中得到下面这条消息:
2012/10/28 19:13:17 [notice] 6540#0: *1 [lua] [string
"content_by_lua"]:2: hello, client: 127.0.0.1, server: localhost,
request: "GET /t HTTP/1.1", host: "localhost"
一个建议是尽量使用最简单的例子来验证你的假设,这样经常可以发现配置上的低级错误,或者可以确认 ngx_lua 的潜在 bug(如果有的话)。
Best regards,
-agentzh