--
邮件自: 列表“openresty”,专用于技术讨论!
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
详情: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
建议: 提问的智慧 http://wiki.woodpecker.org.cn/moin/AskForHelp
教程: http://agentzh.org/misc/nginx/agentzh-nginx-tutorials-zhcn.html
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