From 6c1ec6b0051be93a86257541d008c74230713290 Mon Sep 17 00:00:00 2001 From: loveshell <82163261@qq.com> Date: Sun, 24 Mar 2013 19:12:05 +0800 Subject: [PATCH] add some comments --- waf.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/waf.lua b/waf.lua index 8d25bb3..a9ac75c 100644 --- a/waf.lua +++ b/waf.lua @@ -1,3 +1,4 @@ +--发送syslog数据函数 function syslog(msg) ngx.header.content_type = "text/html" kern = 0 @@ -33,6 +34,7 @@ function syslog(msg) local sock = ngx.socket.udp() local ok, err = sock:setpeername('127.0.0.1', 514) +--上面的ip和端口就是syslog server的ip和端口地址,可自行修改 if not ok then ngx.say("failed to connect to syslog server: ", err) return @@ -43,7 +45,7 @@ sign=level+facility*8 ok, err = sock:send('<'..sign..'>'..msg) sock:close() end - +--日志处理函数 function log(method,url,data) file=assert(io.open("/data/logs/hack/"..ngx.var.server_name.."_sec.log","a"))